Exceptions: Difference between revisions

m
→‎Throw exceptions: pretty-printing
(→‎Catching exceptions: another catch clause for std::exception)
m (→‎Throw exceptions: pretty-printing)
Line 197:
 
===Throw exceptions===
<cpp>
// this function can throw any type of exception
void foo()
{
{
throw MyException();
}
}
 
// this function can only throw the types of exceptions that are listed
void foo2() throw(MyException)
{
throw MyException();
}
</cpp>
 
===Catching exceptions===
973

edits