Hey,
I'm having trouble overloading the ~ operator (the determinant of the matrix) in a case of 2x2 matrices. So i have a matrix class, with the constructor, overloading +, += and ~ operators. the first two are working but I don't know how to overload the ~ one.
here's what I have:
matrix matrix::operator~(matrix &m) {
double x;
x=(m.a11*m.a22)-(m.a12*m.a21);
return x;
of course it's not working cause i can't return a double value in a matrix class. Second of all it says that ~unary operator has too many parameters. But then how do I make a matrix class return only 1 parameter? (since the determinant is only one number).
thanks!