the description of at exit is as follows, can somone give me an example of how it is used??
int atexit( void (*func)(void) );
the description of at exit is as follows, can somone give me an example of how it is used??
int atexit( void (*func)(void) );
Parinoia Means Having All The Facts!
The atexit function will call a chosen function at the end of a program, the nice thing about this function is that it will call something useful such as garbage collection and saving routines even if you abort by way of exit().
-PreludeCode:#include <stdio.h> #include <stdlib.h> void end( void ) { printf ( "The end function was called\n" ); } int main ( void ) { atexit ( end ); printf ( "Normal processing\n" ); return EXIT_SUCCESS; }
My best code is written with the delete key.