1. Exit is used inProgramThe program is terminated at any time during the running process. The exit parameter is returned to the OS. The exit function is also called implicitly at the end of the main function. When the exit function is run, it will first execute the function registered by the atexit () function, and then perform some self-cleaning work, refresh all output streams, close all open streams, and close temporary files created using the standard I/O function tmpfile. Exit is to end a process. It will delete the memory space used by the process and return the error message to the parent process. Return is to return the function value and exit the function.
2. Return indicates the language level, which indicates the return of the call stack, and exit indicates the system call level, which indicates the end of a process.
3. The exit function exits the application and returns a state of the application to the OS. This State identifies some running information of the application. It is related to machines and operating systems. Generally, 0 indicates normal exit. If not, it indicates abnormal exit.
Function prototype void exit (INT status); (header file stdlib. h)
4. Return refers to the return function call. If the return is the main function, it is the exit program.
Exit is to forcibly exit the program at the call. Once the program is run, it will end.