home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_06 / 8n06025a < prev    next >
Text File  |  1990-04-18  |  492b  |  41 lines

  1. *****Listing 2*****
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5.  
  6. void eh1(void);
  7. void eh2(void);
  8. void eh3(void);
  9.  
  10. main()
  11. {
  12.     printf("reg eh1: %d\n", atexit(eh1));
  13.     printf("reg eh2: %d\n", atexit(eh2));
  14.     printf("reg eh3: %d\n", atexit(eh3));
  15.  
  16.     exit(0);
  17. }
  18.  
  19. void eh1(void)
  20. {
  21.     printf("Inside eh1\n");
  22. }
  23.  
  24. void eh2(void)
  25. {
  26.     printf("Inside eh2\n");
  27. }
  28.  
  29. void eh3(void)
  30. {
  31.     printf("Inside eh3\n");
  32. }
  33.  
  34. reg eh1: 0
  35. reg eh2: 0
  36. reg eh3: 0
  37. Inside eh3
  38. Inside eh2
  39. Inside eh1
  40.  
  41.