home *** CD-ROM | disk | FTP | other *** search
- // Get needed include files
- #include <iostream.h>
- #include <eh.h>
-
- void Func1(int flag)
- {
- try {
- cout << "In Func1.\n";
- if (flag)
- throw "String exception";
- }
- catch (int) {
- cout << "Caught an integer exception.\n";
- }
- }
-
- void main()
- {
- try {
- Func1(1);
- }
- catch (char *str) {
- cout << "Caught a string exception: " << str << "\n";
- }
- catch (...) {
- cout << "Caught an unrecognized exception.\n";
- }
- }
-