problem with a function
i wrote this function to find and return the determinant of a 3x3 matrix...
the error i get is the line with the equation and it says
double getDeterminant(double (*matrix))
double a = matrix;
double b = matrix;
double c = matrix;
double d = matrix;
double e = matrix;
double f = matrix;
double g = matrix;
double h = matrix;
double i = matrix;
double det = a(e*i) - (f*h) - b(d*i) - (g*f) + c(d*h) - (e*g);
"error C2064: term does not evaluate to a function taking 1 arguments"
thanks for any help you can give me.
'a', 'b' and 'c' are not functions. They are variables. If you meant it to be a multiplication (like you would do in maths), you need to add a multiplication operator before the parenthesis. You can omit multiplication operators in maths, but not in C++.
itd be easier to change double a to i into an array and loop thru it