Saturday, April 24, 2010

exit Function:

This article will teach you what the exit function does.


Definition of exit Function:

exit function terminates the program process. It is called as "exit(error_status)"
 consider this following program:
 #include<stdio.h>
#include<stdlib.h>


int main()
{
printf("hi");
exit(0);
printf("This won't executed");
}

This program results in
hi
 exit(0) function terminate the program running.  so second printf won't work.

0 comments:

Post a Comment