Jump to content
  • Advertisement
Sign in to follow this  
Pickleninja

Return(ret==0) ??

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

I'm looking at a piece of code and it contains a return statement: Return(ret==0) It's written in C++, but for the life of me I can't remember ever seeing a return statement that looks like this. Does it mean "Return ret if ret is equal to 0"? -Pickle Edit: Just found the answer...thanks, and sorry...I should have looked a little bit harder before posting :(

Share this post


Link to post
Share on other sites
Advertisement
No, == returns a boolean. So it will return true if ret == 0 and false otherwise.

Share this post


Link to post
Share on other sites
If the value of ret is 0 then the return value is true. Otherwise the return value is false.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!