Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
#include
3.
using namespace std;
4.
void myunexpected ()
5.
{
6.
cout
Options:
A .  caught other exception
B .  caught int
C .  unexpected called
D .  both b & c
Answer: Option D

As we are calling set_unexpected (myunexpected) function, this is printing as unexpected 

called and because of operator compliance it is arising an exception.
Output:
$ g++ etea.cpp
$ a.out
unexpected called
caught int



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers