Exit (0) and exit (1), return difference
Exit (0): Run the program normally and exit the program;
Exit (1): Abnormal operation results in exiting the program;
Return (): Returns a function that, if in the main function, exits the function and returns a value.
Detailed said:
1. Return returns the function value, which is the keyword; exit is a function.
2. Return is a language level that represents the return of the call stack, and exit is the system call level, which represents the end of a process.
3. Return is the exit of the function (return); Exit is the exit of the process.
4. Return is provided by the C language, and exit is provided by the operating system (or given in the function library).
5. Return is used to end the execution of a function, using the execution information of the function out of other calling functions; the exit function exits the application, deletes the memory space used by the process, and returns a state of the application to the OS, which identifies some of the application's operational information. This information is related to the machine and the operating system, usually 0 for normal exit, not 0 for abnormal exit. 6. Calling return and exit in a non-main function is obvious, but the phenomenon of calling return and exit in the main function is blurred, and in most cases the phenomenon is consistent.