 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
void
a_function() throw(char, int); //exception spec
|
|
int
main() {
|
|
try { //detect exceptions (in main)
|
|
a_function();
|
|
cout <<"returned from
a_function" <<endl;
|
|
}
|
|
|
catch(char) { //catch char exceptions
|
|
cout <<"char exception
handler called" <<endl;
|
|
}
|
|
|
catch(int) { //catch int exceptions
|
|
cout <<"int exception
handler called" <<endl;
|
|
}
|
|
cout <<"normal program
exit" <<endl;
|
|
return(0);
|
|
}
|
|