Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo C - <b>atexit() register exit function</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
atexit()                 Register Exit Function

 #include   <stdlib.h>

 int        atexit(func);
 atexit_t   func;                        Function to be called

    atexit() registers 'func' as an "exit function".  Upon normal
    termination of the program, exit() calls '*func' just before
    returning to the operating system.  'func' is of type 'atexit_t'
    (defined in <stdlib.h>).

    Returns:    0 is returned on success.  If no space is left to
                register functions, a non-zero value is returned.

      Notes:    Each call to atexit() registers a separate exit function.
                A maximum of 32 functions can be registered. They are
                executed on a last in, first out basis.

See Also: exec...() exit() spawn...()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson