atexit()

Syntax
  #include <stdlib.h>

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

  
Description

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.

Return

atexit() returns 0 if it could register the function, otherwise it returns a non-zero value.

See also

abort() and

exit()