http://www.cs.stanford.edu/cslibrary/PointerFunC.avi
HitoV wrote:Here's another resource about pointers that is much more in depth. Makes my head spin a bit less
http://home.earthlink.net/~momotuk/pointers.pdf
HitoV wrote:Here's another resource about pointers that is much more in depth. Makes my head spin a bit less
http://home.earthlink.net/~momotuk/pointers.pdf
double *p_x; // global pointer
//set the pointer to the address of the actors x, & gets the memory address
p_x = &MyActor1->x;
//set the other actors x to the value of the first actor using the pointer, * dereferences the pointer
MyActor2->x = *p_x;
int Array[5000000];
void function(int* pIntegers)
{
//do stuff
}
function(&Array);
int X;
int A;
int *pX; //my integer pointer
int **ppX; //my pointer to an integer pointer
int ***pppX; // my pointer to and integer pointer pointer
X = 3;
pX = &X;
ppX = &pX;
pppX = &ppX;
A = *pX; // A = X
A == 3 // or A == X
A == **ppX // A == 3
***pppX = 22; // X = 22
pX = &A;
X == 22;
A == 3;
***pppX == 3; //pppX points to ppX which points to pX which points to A which has the value of 3
***pppX = 55;
X == 22;
A == 55;
pppX->ppX->pX->A == 55;
HitoV wrote:Here's another resource about pointers that is much more in depth. Makes my head spin a bit less
Users browsing this forum: No registered users and 1 guest