Vidyalelo
C++ Programming · Q909

C++ miscellaneous

Programming · C++ Programming · question 909

Q909

What will be the output of the following C++ code? #include #include using namespace std; class Polymorphic virtual void Member(); int main () try Polymorphic * pb = 0; typeid(*pb); catch (exception& e) cerr << "exception caught: " << e.what() << endl; return 0;

A.
exception caught: std::bad_typeid
Answer
B.
exception caught: std::bad_alloc
C.
exception caught: std::bad_cast
D.
exception caught: std::bad_id

Answer: Option A

Solution

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