it should be make_identity_matrix(var mat[][4]); Arrays are basically pointers. And you do mat[i][j] instead of *mat[i][j].