Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/utility/program/atexit"

From cppreference.com
< cpp‎ | utility‎ | program
m (Text replace - "{{params}}" to "===Parameters===")
m (Text replace - "{{returns}}" to "===Return value===")
Line 16: Line 16:
  
 
<!-- ======== -->
 
<!-- ======== -->
{{returns}}
+
===Return value===
 
{{cpp|0}} if the registration succeeds, nonzero value otherwise.
 
{{cpp|0}} if the registration succeeds, nonzero value otherwise.
  

Revision as of 17:50, 2 August 2011

Template:cpp/utility/program/sidebar

Defined in header <cstdlib>
int atexit( void (*func)() );

Registers the function pointed to by func to be called on normal program termination (via exit() or returning from main()).

Calling the function from several threads does not induce a data race. The implementation shall support the registration of at least Template:cpp functions.

Parameters

func - pointer to a function to be called on normal program termination

Return value

Template:cpp if the registration succeeds, nonzero value otherwise.

Template:example cpp

Template:see also

registers a function to be called on std::quick_exit invocation
(function) [edit]