Main

main() should always return 0 if the program executed successfully. Specific error codes can be returned.

main() should not be too long, and no actual computations should be done there. It must only call functions or create variables.

Error codes should always be less than 0. -1 usually signifies generic error.

Last updated