Skip to main content
gamedev.net
🔒 Locked

Return(ret==0) ??

Started by Pickleninja 2 replies 1.3k views
Original Post
Pickleninja
Pickleninja
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 :(
gekko
gekko
No, == returns a boolean. So it will return true if ret == 0 and false otherwise.
-- gekko
SiCrane
SiCrane
If the value of ret is 0 then the return value is true. Otherwise the return value is false.
i_luv_cplusplus
i_luv_cplusplus
it means return true if ret is equal to zero, otherwise return false

@up: duh
OpenGL fanboy.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.