Z
Zach
Hi,
I'm trying to get a handle on the various values that may be used with
exit(). I've come across 2 differing definitions:
"The C standard specifies two constants, EXIT_SUCCESS and
EXIT_FAILURE,
that may be passed to exit() to indicate successful or
unsuccessful
termination, respectively."
and
"The C Standard () defines the values 0, EXIT_SUCCESS, and
EXIT_FAILURE."
Does one of these definitions apply to the C90 standard and the other
to C99?
Or do both standards only define the constants EXIT_SUCCESS and
EXIT_FAILURE and most compiler implementations associate 0 with
EXIT_SUCCESS and 1 with EXIT_FAILURE? Which standard should I follow
in general practice?
Also, I've seen in code other values such as:
exit(3);
What do these other values (besides 0 and 1) indicate specifically and
which should I use to have good, portable C code?
Regards,
Zach
I'm trying to get a handle on the various values that may be used with
exit(). I've come across 2 differing definitions:
"The C standard specifies two constants, EXIT_SUCCESS and
EXIT_FAILURE,
that may be passed to exit() to indicate successful or
unsuccessful
termination, respectively."
and
"The C Standard () defines the values 0, EXIT_SUCCESS, and
EXIT_FAILURE."
Does one of these definitions apply to the C90 standard and the other
to C99?
Or do both standards only define the constants EXIT_SUCCESS and
EXIT_FAILURE and most compiler implementations associate 0 with
EXIT_SUCCESS and 1 with EXIT_FAILURE? Which standard should I follow
in general practice?
Also, I've seen in code other values such as:
exit(3);
What do these other values (besides 0 and 1) indicate specifically and
which should I use to have good, portable C code?
Regards,
Zach