1.

What is the output of this program?
#include <iostream>
#include <typeinfo>
using namespace std;
class Poly
{
virtual void Member(){}

};
int main ()
{
try
{
Poly * ptr = 0;
typeid(*ptr);
}
catch (exception& ex)
{
cout << "An Exception caught: " << ex.what() << endl;
}
return 0;
}

A. An Exception caught: std::bad_alloc
B. An Exception caught: std::bad_cast
C. An Exception caught: std::bad_typeid
D. All of above
E. None of these
Answer» D. All of above


Discussion

No Comment Found

Related MCQs