Jump to content
  • Advertisement
Sign in to follow this  
CoB_ChrizZz

strange "ostream& operator<<" issue

This topic is 2511 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

hello again ! ^^

well this time it says "too many parameters for this operator function" in line 21 but i can't see why there should be a problem due to the second Student reference &[color=#000000][font=Consolas, Menlo, Monaco,]st[/font]. ( should be something basic :/ )

http://pastebin.com/XevHj3Cz

Share this post


Link to post
Share on other sites
Advertisement
You defined it as a non-static member function. Make it either static, or a non-member function.

Share this post


Link to post
Share on other sites
You cannot make it a member function. If it is a member function, it has to be a member function of the ostream class since that is what's on the left hand side of the expression when you invoke the operator. Make it a free function instead of a member function.

Share this post


Link to post
Share on other sites
Hidden
wow you guys were really fast, thanks for your replys !!


well i have to make it a memberfunction of student (preparing for a test)
I tried static, i tried void. But with neither one i can go like: " cout << st2; " in the main

Share this post


Link to post
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!