Search code examples
cc11

Difference between exit and quick_exit


What are the differences between void quick_exit( int exit_code ) which was included in c11 standard and void exit( int exit_code ) function that already existed before c11 standard?


Solution

  • exit ensures that stream buffers are flushed, closed, etc. Such behavior for quick_exit is not specified by the standard.

    With these you can define two ways of quitting an application, one that lets you terminates with full cleaning (made by functions registered with atexit), and the other to let applications terminate more quickly without cleaning too much things (calls to functions registered with at_quick_exit).