Because in C the array variable is not a pointer. So taking address of will not give you pointer to pointer.
It will be equal to itself (array == &array). Array only "decays" to pointer when used in expressions like "array + 3".
This is easier to understand if you think what actual storage looks like.
If you do "int arr[4] = { 0, 1, 2, 3 };" then memory on stack will look like this:
| +---+---+---+---+
+ 0 + 1 + 2 + 3 +
+---+---+---+---+
^
|
+-- "arr" variable starts here
|
So if in your code write "int* ptr = &arr;" where ptr will point to? Obviously to location where memory of "arr" starts, right? But it is exactly same location:
| +---+---+---+---+
+ 0 + 1 + 2 + 3 +
+---+---+---+---+
^
|
+-- "ptr" points to here
|
If you try to display value of "arr" and "&arr" you'll see that they have exactly same value (address).
To work around this issue create temporary pointer:
| SDL_Surface** spriteTextArray = spriteText;
initGfx(&spriteTextArray, &spriteText, screenSurface);
|
But why do you need to pass address of array to this function? Cann't it simply accept "SDL_Surface **textures" ? Triple pointer here would mean that function wants to change whole array itself:
| SDL_Surface** sprites;
initGfx(&sprites, ...); // initGfx modifies sprites array
use(sprites[0]); // now we can use it
|
Do you really need address of array here?