• Advertisement
Sign in to follow this  

Operator Overloading Question

This topic is 2614 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

are these 2 statements the same?? if not what's the difference


istream& operator>>(istream& in, Sale& aSale)
{
//blah
return in;
}


istream& operator>>(istream& in, Sale& aSale)
{
//blah
return *this;
}


Share this post


Link to post
Share on other sites
Advertisement
blah nvm i just realized what i was confused about, overloaded << and >> functions are usually friend functions so they can operate on both operands! when it's a friend function it does not belong to a specific class and does not own a *this pointer! sorry for the post :P and thanks

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement