Hey everyone,
Question for some C users.
I have a polynomial class in which I have overloaded the '*' operator declaring it a 'friend' of the Polynomial class. The definition looks like this:
friend Polynomial operator * (const Polynomial & poly1, const Polynomial &poly2)
{
Polynomial retValue;
//do stuff
return retValue;
}
In the Main function I have:
Polynomial p = p1 * p2;
when I go to print the variable 'p', in the main function it shows as empty, however, when I print the 'p' variable from inside the '*' function, immediatley before I return it holds the correct result.
Any idea what is going on?
thanks for any help