|
-
April 24th, 2003, 04:41 PM
#1
operator overloading
i am trying to overload this function, but the compiler disagrees.
heres the function.
bool employee: perator == (const employee &p)
{
return *this == p;
}
heres my use of the class and and the overloaded function.
int main(void)
{
employee emp1;
employee emp2;
if(emp1 == emp2)
std::cout << "\n\t\nobjects equal\n\n";
return 0;
}
heres the error the compiler gives.
error C2678: binary '==' : no operator found which takes a left-hand operand of type 'const employee' (or there is no acceptable conversion)
any suggestions.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|