#include <iostream>
#include <exception>
using namespace std;
class myException: public exception
{
virtual const char* what() const throw ()
{
return "myException happened";
}
};
int main () {
try
{
throw myException( );
}
catch (exception& e)
{
cout << e.what() << endl;
}
return 0;
}