The paramarater is the value that the program will return to the operating system so that other programs can use it for some purpose. The value 0 traditionally means the program exits normally without error. Any other value would mean the program encountered some kind of error. The value of the parameter to exit() can be anything you want, its not limited to the three that you posted.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Exit(0) , is commonly used as a successful exit message. Usually, you don't use it, use instead Return 0; Exit(1) Is used to reference some kind of abnormal program termination.
Nichito
Posting Virtuoso
1,602 posts since Mar 2007
Reputation Points: 424
Solved Threads: 57
>>Usually, you don't use it, use instead Return 0;
Unless, of course, exit() is used outside main().
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Nichito
Posting Virtuoso
1,602 posts since Mar 2007
Reputation Points: 424
Solved Threads: 57