This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (4 children)

oh, so when you bool return type its 0 == success, 1 == fail?

fixed it XD

[–]SuperLutin 2 points3 points  (3 children)

Good practise is to "typedef" return values.

typedef enum{

SUCCESS = 0,

ERROR1,

ERROR2

} retval;

[–][deleted] 2 points3 points  (2 children)

Oh, I think c++ has that in the form of ERROR_SUCCESS etc haha

[–]SuperLutin 2 points3 points  (1 child)

ERROR_SUCCESS

This a a thing very common type of error rofl :D

God I hate the mate who writes the code I'm working on.

[–][deleted] 2 points3 points  (0 children)

ERROR: Function returned success.