1.

What is the output of this program?
#include <iostream>
#include <exception>
#include <typeinfo>
using namespace std;
class Sample
{
virtual int Function()
{
}
};
int main ()
{
try
{
Sample *ptr = NULL;
typeid (*ptr);
}
catch (std::exception& TypeVar)
{
cout << "Exception Occurred: " << TypeVar.what() << endl;
}
return 0;
}

A. Compilation Error
B. Null
C. Exception Occurred: std::bad_alloc
D. Exception Occurred: std::bad_typeid
E. None of these
Answer» E. None of these


Discussion

No Comment Found

Related MCQs