Namespaces
Variants
Views
Actions

exit

From cppreference.com
< c‎ | program
Revision as of 17:41, 2 November 2012 by P12bot (Talk | contribs)

Defined in header <stdlib.h>
void exit( int exit_code );

Causes normal program termination to occur.

Several cleanup steps are performed:

  • functions passed to atexit are called.
  • all C streams are flushed and closed
  • files created by tmpfile are removed
  • control is returned to the host environment. If exit_code is EXIT_SUCCESS, an implementation-defined status, indicating successful termination is returned. If exit_code is EXIT_FAILURE, an implementation-defined status, indicating unsuccessful termination is returned. In other cases implementation-defined status value is returned.

Contents

Parameters

exit_code - exit status of the program

Return value

(none)

Example

See also

Template:c/program/dcl list abortTemplate:c/program/dcl list atexitTemplate:c/program/dcl list quick exit