C: The functions and differences of exit(0), _exit(0), exit(1), exit(-1)

exit(0): Run the program normally and exit the program.

_exit (0): The result cannot be output, the I/O cache is not cleared, and no printing is performed.

 

exit(1): Abnormal operation causes the program to exit;

exit(-1): Abnormal operation causes the program to exit, similar to 1.

The effect of return v; in main is the same as exit(v);.

Guess you like

Origin blog.csdn.net/qq_32301683/article/details/100761546