atexit [C++ Reference]
Keywords: c,other,atexit
Date: 2008-10-14T15:42:02-0700

[[atexit]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

## atexit

Syntax:

        #include <cstdlib>
        int atexit( void (*func)(void) );

The function atexit() causes the function pointed to by func to be called when the program terminates. You can make multiple calls to atexit() (at least 32, depending on your compiler) and those functions will be called in reverse order of their establishment. The return value of atexit() is zero upon success, and non-zero on failure.

Related Topics: abort, exit

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •