Vidyalelo
C++ Programming · Q62

Standard Template Library (STL) in C++

Programming · C++ Programming · question 62

Q62

What will be the output of the following C++ code? #include #include using namespace std; class myexc: public exception virtual const char* what() const throw() return "My exception"; myex; int main () try throw myex; catch (exception& e) cout << e.what() << endl; return 0;

A.
My
B.
My exception
Answer
C.
No exception
D.
exception

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board