home *** CD-ROM | disk | FTP | other *** search
- // Get needed include files
- #include <iostream.h>
- #include <eh.h>
-
- class First1 { };
- class First2 { };
- class Last : public First1, public First2 { };
-
- Last MyLast;
-
- void Func1(int flag)
- {
- cout << "In Func1.\n";
- if (flag)
- throw MyLast;
- }
-
- void main()
- {
- try {
- Func1(1);
- }
- catch (First1&) {
- cout << "Caught a First1 exception.\n";
- }
- catch (First2&) {
- cout << "Caught a First2 exception.\n";
- }
- catch (...) {
- cout << "Caught an unrecognized exception.\n";
- }
- }
-