Synopsis
int atexit(void (*func)(void));
Description

atexit registers function to be called when the application has exited. The functions registered with atexit are executed in reverse order of their registration. atexit returns 0 on success and non-zero on failure.