PSXDEV snippets : Array vs Pointer


In C, not sure about the syntax to have a pointer to a double(2d?) array as a function argument ? (If that's even possible). Here's some pseudocode that might help understand the question:

int myarray[2][8];
void dostufftoarraycontent(int * myarray){

Specifically, should I use int * myarray, int * myarray[], int * myarray[2][8] ... ?


Nicolas Noble : basically, your 2d array here is just a syntax sugar for a 1d array

sickle : oh this kinda makes sense now since what you said about blah[y] being the same as

*(blah + y) so with blah[x][y] instead of x incrementing the pointer by x, it's

( x * sizeof(subarray) ) like :

*( x*sizeof(subarray)  + y*(sizeof(y)) + blah)


Nic & Sickle -