summaryrefslogtreecommitdiff
path: root/reference/C/EXAMPLES/atexit.c
blob: 2371f2fcd5aff3d9be090238d6877c9c5b303bed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

/******************************************************************
 *
 * Purpose: Program to demonstrate the use of atexit.
 * Date:    17-Feb-97
 * Author:  M J Leslie.
 * Descrip: Regester a function to be executed when a program normally
 *          terminates.
 *
 ******************************************************************/

#include <stdlib.h>

void End(void);
        
main()
{
    atexit(End);

    printf("Program is about to end\n");
}

void End(void)
{
    printf("Program ended\n");
}