0

1.Difference between break statement & exit() statement and 2. difference between exit(0); and exit(1);

Break & exit statement

9th Apr 2020, 4:25 PM
Manish Shee
Manish Shee - avatar
2 Answers
+ 1
1. The break statement breaks out of the current basic block and resumes execution at the next line outside of the basic block. The exit() function calls an operating system API that stops execution of the process. 2. The status parameter in exit() is the same as the return value that you would return from main(). It is a final program status value that can be checked by shell scripts to determine whether the program reported success or failure in execution. Most programs use 0 to mean success and 1 to mean failure. But you are allow to change its meaning and value as you please.
9th Apr 2020, 5:43 PM
Brian
Brian - avatar
+ 1
Thank you
9th Apr 2020, 5:45 PM
Manish Shee
Manish Shee - avatar