// A8.cpp #include #ifndef Borland #include // visual C++ 5.0 #else #include // Borland C++ 5.0 #endif using namespace std; class X { long double array[100000000];/* big class */ }; class myExcept : public exception { /* ... */ } myE; void main() { X *xptr; try { try { xptr = new X; if(!xptr) { // throw exception if new does not cout << " new did not throw exception\n"; throw myE; } } catch(...) { // if new does throw exception, then throw myE; // catch it and throw the one we want } } catch(myExcept &myE) { cout << " caught myE exception\n"; } }