VMS Help
CRTL, atexit
*Conan The Librarian
|
Registers a function that is called without arguments at program
termination.
Format
#include <stdlib.h>
int atexit (void (*func) (void));
func
A pointer to the function to be registered.
0 Indicates that the registration has succeeded.
nonzero Indicates failure.
The longjmp function cannot be executed from within the handler,
because the destination address of the longjmp no longer exists.
#include <stdlib.h>
#include <stdio.h>
static void hw(void);
main()
{
atexit(hw);
}
static void hw()
{
puts("Hello, world\n");
}
Running this example produces the following output:
Hello, world