0
why we need to pass an argument in an exit command?
exit(1);
4 Réponses
0
whenever we quit an application it returns a value . 0 means program runs ok any other no means program has error.
so exit command has a parameter as integer
0
sorry sir I could not understand . Can u explain again
0
when any program exited it returns a value.
this value is called exit status.
https://en.m.wikipedia.org/wiki/Exit_status
if it returns 0 it means the program works properly without any error.
exit method exit you application with returning the parameter on it.
ex
exit(0);
means the exit status is 0.
if exit (1);
means the exit status is 1
0
The exit argument will give you the indication of the exit state
eg:
-1 = ERROR
1 = OK