Hi

I was trying to calculate the determinant of a 2X2 matrix. but the problem is passing in a 2D array. I know you need to give number of columns but in that it only declares 1D array. Follwing should make more sense.

I am calling this function by:Code:double det(double M[][5],int i,int j) { double det = 0; if(i == j == 2) { det = M[i-2][j-2] * M[i-1][j-1] - M[i-1][j-2] * M[i-2][j-1]; return det; } }

where Matrix is 2D array with values.Code:calcdet = det(Matrix,2,2);

Any help would be really appreciated.