Q977
What will be the output of the following C++ code? #include #include using namespace std; void myunexpected () cout << "unexpected called "; throw 0; void myfunction () throw (int) throw 'x'; int main () set_unexpected (myunexpected); try myfunction(); catch (int) cout << "caught int "; catch (...) cout << "caught other exception "; return 0;
A.
caught other exception
B.
caught int
C.
unexpected called
D.
both caught int & unexpected called
AnswerAnswer: Option D
Solution
Answer: Option D
No explanation is given for this question Let's Discuss on Board