Normally we use exit(0) in programs.why dont we use exit(1)? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

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

22nd Sep 2017, 5:01 PM
looper
looper - avatar
1 Answer
+ 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