[EMAIL PROTECTED] wrote:

> I've seen a lot of source code lately. My idea the best way to learn a
> language ...

Not necessarily. There's some really poor code out there.

> I've noticed that exit() can take a parameter. I've seen exit(0), exit(1),
> exit(2) and even exit(10). What does the parameter mean ?

It is the program's exit status. This is the value which the parent
process will receive if it calls wait() (or similar) on the process.

> I can't find any table with its possible values ...

There isn't one. The only standard values are (from stdlib.h):

        #define EXIT_FAILURE    1       /* Failing exit status.  */
        #define EXIT_SUCCESS    0       /* Successful exit status.  */

In general, zero indicates successful termination whilst nonzero
indicates some form of error. Individual programs may use particular
exit codes to indicate specific conditions.

Note that there may be restrictions upon the set of valid exit codes. 
On Linux (and AFAIK, most other Unices), they should be in the range 0
to 255 (see the definition of the __WEXITSTATUS() macro in
waitstatus.h).

-- 
Glynn Clements <[EMAIL PROTECTED]>

Reply via email to