hi all,
tips:
exit() means terminate program executions.
1) exit(0) when it terminate normally
exit(1),exit(-1)...or any value from 1 to 127 when it terminate abnormally
or abort or some error.
2)
exit(EXIT_SUCCESS) means exit(0)-successfully termination
exit(EXIT_FAILURE)means - failure termination.
3)
In main return expr means exit(expr);
example:
#include<stdio.h>
main()
{
......
...
return 0; //or exit(0);
}
4)If you are way down in some nested calls of functions and you want to
"exit" immediately, without returning all of the way to main(), then use
exit:
example
#include<stdio.h>
#include<stdlib.h>
......
void fun1()
{
if (bad happened){
exit(EXIT_FAILURE);
}
else{
do good thing
}
}
On Wed, Jul 16, 2008 at 9:38 AM, kamal_jeet_kaur <[EMAIL PROTECTED]>
wrote:
> Can any integer be mentioned in exit() function then why do we specify
> 0(zero only?
>
>
>
[Non-text portions of this message have been removed]