You can not use arrays or structs as arguments to a function. Functions only accept and return variables and pointers.

An array is the same as a pointer, so this

function load_matrix(var* M);

works for multidimensional arrays just the same way as for a single dimensional array. However for accessing the array members within a function, you still need the [x*max_y + y] approach because the function can not know the dimensions of your array.

Hope this helps.