To be used as an array, the compiler must know the internal step of the array, so it also:
void eval_matrix( int m[5][2] ) { ...
or
void eval_matrix( int m[][2], size_t od ) { ...
or simply:
void eval_matrix( int* p, size_t od, size_t id ) { ...
In any case, this is syntactic sugar - the array decomposes into a pointer.
In the first two cases, you can refer to the elements of the array, as usual, m[i][j] , but in the third case you will need to compensate for it as p[i*id + j] .
source share