home *** CD-ROM | disk | FTP | other *** search
/ Using Visual C++ 4 (Special Edition) / Using_Visual_C_4_Special_Edition_QUE_1996.iso / ch13 / term.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1995-09-18  |  377 b   |  22 lines

  1. // Get needed include files
  2. #include <eh.h>
  3. #include <stdlib.h>
  4. #include <iostream.h>
  5.  
  6. void MyTerminate()
  7. {
  8.     cout << "I regret to inform you that the exception could "
  9.          << "not be dispatched.\n";
  10.     cout << "I'm going away now...\n";
  11.     exit(-1);
  12. }
  13.  
  14. void main()
  15. {
  16.     set_terminate(MyTerminate);
  17.     try {
  18.         throw "Won't somebody catch me?";
  19.     }
  20.     catch (int) { }
  21. }
  22.