Original Post
There we are, a problem with operators overloading is confusing me... Well, as stated on many sites, I overtloaded the '=' operator in the following way: and the '*' operator in this one: when I compile it I get the following error from gcc (the version provided with Dev-C++ 5): what's going wrong? Thank you!
matrix &operator = (matrix &m)
{ for(int i = 0; i < 4; i++) for( int j = 0; j < 4; j++) mat[j] = m.mat[j]; return *this;}
matrix matrix::operator * (matrix &m)
{
matrix t;
for(int i = 0; i < 4; i++)
for(int j = 0; j < 4; j++)
t.mat[j] = mat[0]*m.mat[0][j] + mat[1]*m.mat[1][j] + mat[2]*m.mat[2][j] + mat[3]*m.mat[3][j];
return t;
}
101 C:\Alessandro\progetti\quarktracer\geometry.cpp no match for 'operator=' in 'a = matrix::operator*(matrix&)((&c))'