I am reading through a C book and I am up to 'pointer equivalency' and I am having trouble with this code snippet:
Code:
int i, array[10];
int *pointer, *intPtr;
pointer = array;
i = 4;
//I know these two statements do the exact thing
intPtr = &array[ i ];
intPtr = pointer + i;
//I need help with this stuff below
int x;
x = pointer[ i ];
x = *(array+i)
intPtr = &pointer[ i ];
intPtr = array + i;
The book then goes on to say that you can use pointers in these [] and that you can use array variable names as if they where pointers to the first element. I understand what the array variable name and how it points to the first element but I am having trouble understanding this snippet.