Jump to content
  • Advertisement
Sign in to follow this  
nuclear123

Operator Overloading Question

This topic is 2708 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!