> void foo(int **arr);
Would bevoid foo(int (*arr)[10]);
or more simplyvoid foo(int arr[ ][10]);
or even just copy/paste for the lazyvoid foo(int array[10][10]);
The definition of course follows the prototype.

The pointer in main() follows the same logic, sayint (*ptr)[10] = array;

...and I want to create a function that could take any of them as an argument?
Well, if I call malloc to allocate memory for those arrays, then it's no problem. But what if I want to keep it like that, and making foo() able to take either array1 or array2?

...and I want to create a function that could take any of them as an argument?
Well, if I call malloc to allocate memory for those arrays, then it's no problem. But what if I want to keep it like that, and making foo() able to take either array1 or array2?

This comes up a lot in interfacing with apis. For example, you have to do it to use libpng since it deals with arbitrary sized 2d arrays. You have to do some preprocessing.