Most of the places I have seen the return code values are done like this,
for success status return , #define SUCCESS 0 and other no zero numbers for all other error cases.
My question is , why we selecetd zero for SUCCESS case? Is there any specific programming best practice concerns for that?
/R
It’s an old C habit to return 0 for success and some other code for errors, so you can say:
However, predicates usually work the other way around, returning 1 for “success” (or
truefrom<stdbool.h>).