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