ex-7.5.c (378B)
1 /* 2 * Advanced Programming in the UNIX(r) Environment 3 * 4 * Exercise 7.5 5 */ 6 7 #include <stdio.h> 8 #include <stdlib.h> 9 10 typedef void ExitFunc(void); 11 12 ExitFunc efunc; /* Exit function */ 13 int atexit(ExitFunc); /* Prototyped again */ 14 15 int 16 main(void) 17 { 18 19 atexit(efunc); 20 21 return EXIT_SUCCESS; 22 } /* eof main() */ 23 24 void efunc(void) 25 { 26 printf("Exiting...\n"); 27 } /* eof efunc() */ 28