V
Vicky
Please tell me at
(e-mail address removed)
(e-mail address removed)
Please tell me at
(e-mail address removed)
Parahat said:The C standard specifies two defines EXIT_SUCCESS and EXIT_FAILURE that
may be passed to exit() to indicate successful or unsuccessful
termination, respectively.
Parahat Melayev said:The C standard specifies two defines EXIT_SUCCESS and EXIT_FAILURE that
may be passed to exit() to indicate successful or unsuccessful
termination, respectively.
The use of EXIT_SUCCESS and EXIT_FAILURE is slightly more portable (to
non-Unix environments) than that of 0 and some nonzero value like 1 or
-1. In particular, VMS uses a different convention.
more can be found at "man 3 exit"...
Kenneth Brody said:On many systems, exit(1) signals some sort of failure, however there
is no guarantee.
Right.
As I recall, the C standard only recognizes three standard exit
values:
EXIT_SUCCESS -- successful termination
EXIT_FAILURE -- unsuccessful termination
0 -- same as EXIT_SUCCESS
Keith said:Both 0 and EXIT_SUCCESS indicate successful termination, but there's
no guarantee that EXIT_SUCCESS == 0; EXIT_SUCCESS could be some
non-zero value that also indicates successful termination.
On the other hand, there's no good reason for an implementation to
define EXIT_SUCCESS as anything other than 0, and I've never heard of
an implementation that does so (not even VMS). Portable code wouldn't
be able to make use of the distinction.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.