Labels: C ++ C memory Kernel
The difference between exit () and return: According to ansi c, return and exit () are used in the originally called Main () with the same effect. However, note that "initial call" is used here ". If main () is in a recursive program, exit () will still terminate the program; but return will hand over control to the first level of recursion until the first level, at this time, return will terminate the program. Another difference between return and exit () is that it terminates the program even if exit () is called in a function other than main. _ Exit () differs from Exit: header file: Exit: # include <stdlib. h> _ Exit: # include <unistd. h> _ exit () function: directly stop the process, clear its memory space, and destroy various data structures in the kernel. Exit () the functions are encapsulated based on these and several processes are added before execution and exit. The biggest difference between the exit () function and the _ exit () function is that the exit () function checks the file opening before calling the exit system, and writes the content in the File Buffer back to the file.
Exit () and _ exit () and return