
Patrick B. answered 06/22/19
Math and computer tutor/teacher
For a boolean variable , YES, 1 = true and 0 = false
BUT.... typically the return value of the function is ZERO, if the function completed it's
task successfully and everything worked ok...
But upon error, if something goes wrong, the function returns a NON-ZERO value,
which indicated what happened during the execution of the function. That way, the
API is designed so that the cause of the error can be identified, allowing for trouble
shooting and debugging.
Think of it like this.....
//I am going to call the function to DoSomething() ....
int iReturn = DoSomething();
WAS THERE AN ERROR???? 0 = no error, everything was fine
Non-zero means something happened, something went wrong...
IT is pretty much an industry standard that zero is returned on success