jagguy posted:
hi
could someone tell me a good website that explains pointer to pointers
well. Not just simple stuff like 2d arrays passing , or pointing to
another int variable
A pointer variable stores a memory address. Plain and simple.
If it's a pointer variable of any kind, it stores a memory address.
The following variable stores an integer:
int k;
The following variable stores a memory address:
int *p;
It doesn't just store ANY memory address though, it's supposed to store
the memory address of an "int".
How do we store the memory address of an "int*". Simple, with a pointer
to an "int*":
int **pp;
Here's a sample:
int main()
{
int k = 5;
int *p = &k;
int **pp = &p;
int ***ppp = &pp;
int ****pppp = &ppp;
int *****ppppp = &pppp;
*****ppppp = 7;
}
-Tomás