Function name: Exit () header file: Stdlib.h (if the conversation file for "VC6.0" is: windows.h) feature: Closes all files and terminates the process being executed. Exit (1) indicates an exception exit. This 1 is returned to the operating system. Exit (x) (x not 0) indicates that an exception exit exit (0) indicates that the parameters for normal exit exit () are passed to some operating systems, including Unix,linux, and Ms DOS for use by other programs. Stdlib.h:void exit (int status); parameter: status//Program exit return value the difference between exit () and return: According to ANSI C, the effect of using return and exit () in the original invocation of main () is the same. Note, however, that this is called "initial invocation." If main () is in a recursive program, exit () still terminates the program, but return transfers control to the previous level of recursion until the first level, at which point the return terminates the program. Another difference between return and exit () is that even if you call exit () in a function other than main (), it terminates the program. The difference between _exit () and exit: Header file: Exit: #include <stdlib.h>_exit: #include <unistd.h>_exit () function: direct the process to stop running, clear the memory space it uses. and destroys its various data structures in the kernel; the exit () function makes some packaging on these bases, adding a number of operations before the exit is executed. The most important difference between the exit () function and the _exit () function is that the exit () function checks the opening of the file before calling the exit system, and writes the contents of the file buffer back to the file.
Exit and return