#include #include using namespace std; class MyException { public: string messg ; MyException( string str1 ) { messg = str1 ; } }; int main() { try { throw MyException("Error") ; } catch ( MyException& e1 ) { cout << e1.messg << endl ; } return 0; }