I'm struggling to pass a C99 static 3D array of variable length to a function. I know this has been asked here on SO before, but I tried every solution I found so far, none of them worked. I have a following code:
int N;
int foo( ? ){
// do stuff
}
int main(){
cin >> N;
int arr[N][N][N];
foo(arr);
return 0;
}
The question is what to put instead of '?'. Among other things I tried creating a pointer to this 3D array and passing the pointer according to the answer here but that also would compile.