hi guys just a quick question on pointers and trying to understand them in more depth
so I create a pointer py then I create a pointer that points to a pinter ppx then I assign the value of ppx to the address of py BUT now this is the part I don't understand *ppx = new int;
how can I use *ppx when I never created a pointer called *ppx? why and how can I set *ppx which I never declared to a random int value from the free store?
1 2 3
*ppx = newint;
and what exactly is this statement doing ^^
1 2 3 4 5 6 7
int *py;
int **ppx;
ppx = &py;
*ppx = newint;
cout << ppx << endl;
cout << **ppx << endl;
Hi,
You can say that a pointer is just some kind of a special integer variable that solely stores the memory address to another variable. And that's why a pointer variable can be called a "memory address pointer" variable.