19.3.2 (cont.) Throwing Objects

Errors are now indicated by throwing an instance of this class:

try
{
   . . .
   throw MyApplicationError("illegal value");
   . . .
}
catch (MyApplicationError& e)
{
   cerr << "Caught exception " << e.what() << "\n";
}

prev |top |next