Hi all,
I thought I understood using pointers in arrays but it seems I don't! - maybe you can explain.
Declaring and initialising a simple 3x3 matrix:
PHP Code:
unsigned int myArray[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
Why do I get the same address when I do the following:
PHP Code:
printf("\n%d %d %d", myArray, &myArray, *myArray);
Finally, how can I explicitly declare a pointer-to-a-pointer, e.g. myArrayPtr, to point to the start of myArray and have the ability to access array elements using the following notation *(*(myArrayPtr + 1) + 1) - in this case element at (2,2).
I realise that using *(*(myArray + 1) + 1) works, but I just want to understand how to declare pointer to the memory block occupied by myArray and access using the same notation.
regards