c++ - Returning different int values for main() -


this question has answer here:

i've searched find answer specific question not find 1 matched. understand return 0 , return exit_success same thing of saying program ended successfully, if return 1 or return 2 or other int value matter? different int values mean different things compiler or returning int mean program terminated successfully, in case doesn't matter int value put in? (limited) knowledge, seems int main() needs return int in order terminate. wrong?

thanks , apologize if asked before, wasn't able find it.

from: http://en.wikipedia.org/wiki/exit_status

"the specific set of codes returned unique program sets it. typically indicates success or failure. value of code returned function or program may indicate specific cause of failure. on many systems, higher value, more severe cause of error.[1] alternatively, each bit may indicate different condition, ored give final value; example, fsck this."

in other words - 0 or exit_success indicate program ran successfully. other values (including exit_failure) used indicate failure. each individual program may optionally use different program defined codes indicate different failure reasons.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -