Using visual studio 2003
In a header file I have as follows
Code:
class Vector2_1
{
private:
double a, b;
public:
Vector2_1() {a=0; b=0;}
Vector2_1(double vec1, double vec2):a(vec1), b(vec2) {}
void SetSpecificValue(double value, int pos);
double GetSpecificValue(int pos) const;
};
class Vector1_2:public Vector2_1
{
public:
Vector1_2* Vector1_2::operator * (const Matrix2_2& M); //This is the problematic line
};
class Matrix2_2
{
private:
double M11, M12, M21, M22;
public:
Matrix2_2(double UPLEFT, double UPRIGHT, double DOWNLEFT, double DOWNRIGHT):M11(UPLEFT), M12(UPRIGHT), M21(DOWNLEFT), M22(DOWNRIGHT) {}
Matrix2_2() {M11=0; M12=0; M21=0; M22=0;}
void SetSpecificValue(double value, int row, int column);
double Getspecificvalue(int row, int column) const;
Matrix2_2* operator * (const Matrix2_2&);
Vector2_1* operator * (const Vector2_1&);
};
for some reason I get the following error
error C2143: syntax error : missing ',' before '&'
I tried to remove the CPP from the solution and leave the header only. The error disappeared. Adding the CPP with no contents but #include "Matrix.h" returns the error.
Help?