+ 3

Normally we use exit(0) in programs.why dont we use exit(1)?

22nd Sep 2017, 5:01 PM
looper
looper - avatar
2 Answers
+ 4
The number is the exit code. If it's a normal exit you use 0. Any other number is (by convention) some sort of exception or status to pass back to the calling process.
22nd Sep 2017, 5:26 PM
Kirk Schafer
Kirk Schafer - avatar