So I have the following example in some lecture notes
void f(int **p){}
void g(int *p[]){}
void h(int p[2][3]){}
int main(){
int **a;
allocate_mem(a); // allocate memory for a
f(a); // OK!
g(a); // OK!
// h(a); // NOT OK
int b[2][3];
// f(b); // NOT OK
// g(b); // NOT OK
h(b); // OK!
return 0;
}
(without any further explanation/comments). I am struggling to understand exactly why f(b) and g(b) would be illegal. Both of these functions are designed to accept two-dimensional arrays, and we are calling them with one. How does that not work? I assume the difference lies in the allocation of memory, but how would that affect how a function accepts it as input?