C examples for stdlib.h:at_quick_exit
function
<cstdlib> <stdlib.h>
Set function to be executed on quick exit
int at_quick_exit (void (*func)(void)) noexcept; int at_quick_exit (void (*func)(void));
Parameter | Description |
---|---|
function | Function to be called. The function shall return no value and take no arguments. |
A zero value is returned on success.
On error, a non-zero value is returned.
#include <stdio.h> #include <stdlib.h> void fnQExit (void) { puts ("Quick exit function."); } int main ()//from w ww . j ava2s .co m { at_quick_exit (fnQExit); puts ("Main function: Beginning"); quick_exit (EXIT_SUCCESS); puts ("never executed"); return 0; }