#include <stdlib.h>
int atexit(void (*func) (void));
atexit() lets you install a function that is to be executed just before the normal termination of the program. You can register at most 32 functions with atexit(). These functions are called in the reverse order they were registered.
atexit() returns 0 if it could register the function, otherwise it returns a non-zero value.
abort() and