I keep getting the error extra qualification on member 'Operator>' and I don't understand why. The error is with the statements below. I also tried changing it so that it just reads Employee2 operator>(Employee2& emp) but then it says it must have exactly 2 variables. Any help on this would be greatly appreciated.
bool Employee2::operator>(Employee2& emp); //in my header file
bool Employee2::operator>(Employee2& emp) //in my Employee2.cpp file
{
if(this->GetTotalEarned() > emp.GetTotalEarned())
{
cout << "The first Employee2 has earned more" << endl;
};
if(emp.GetTotalEarned() > this->GetTotalEarned())
{
cout << "The second Employee2 has earned more" << endl;
};
if(emp.GetTotalEarned() == this->GetTotalEarned())
{
cout << "Both Employee2's have earned the same amount" << endl;
}
return false;
}
sorry for the confusion, I'm still a little new to the forum but below is the full header code, most isn't important to know but the
bool Employee2::operator>(Employee2& emp); that is giving me errors in in public.