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

  1. // Get needed include files
  2. #include <eh.h>
  3. #include <iostream.h>
  4.  
  5. void Func1()
  6. {
  7.     try {
  8.         throw "Something went wrong!";
  9.     }
  10.     catch (char *) {
  11.         cout << "Doing some initial processing...\n";
  12.         throw;
  13.     }
  14. }
  15.  
  16. void main()
  17. {
  18.     try {
  19.         Func1();
  20.     }
  21.     catch (char*) {
  22.         cout << "Doing some secondary processing.\n";
  23.     }
  24. }
  25.