Why does this code give the error message “IntelliSense: too many parameters for this operator function”
int operator+(PerfectNum a,PerfectNum b)
{
return (a.thenum+b.thenum);
}
PerfectNum is a regular class, and thenum is an int.
This method is in the class.
You’re defining this as a member function, right?
In that case, the left hand side is simply
*this: