Pointers with multi dimensional arrays problem

yes. but the compiler doesn't know that the pointer is to a matrix with 5 columns.

yes,
val = Array [(row * N_COL) + col];
is the same as
val = Array [row][col];