How do I pass the m matrix to foo()? if I am not allowed to change the code or the prototype of foo()?
void foo(float **pm) { int i,j; for (i = 0; i
You can't. m is not compatible with the argument to foo. You'd have to use a temporary array of pointers.
m
foo
int main() { float m[4][4]; int i,j; float *p[4]; p[0] = m[0]; p[1] = m[1]; p[2] = m[2]; p[3] = m[3]; for (i = 0; i < 4; i++) for (j = 0; j < 4; j++) m[i][j] = i+j; foo(p);