Như Quỳnh Lan
New member
What will be the output of the following C++ code?
A. NULL
B. Exception:bad_alloc
C. Exception:std:bad_typeid
D. Exception:std:bad_type
Code:
#include <iostream>
#include <exception>
#include <typeinfo>
using namespace std;
class Test1
{
virtual int Funct()
{
}
};
int main ()
{
try
{
Test1 * var = NULL;
typeid (*var);
}
catch (std::exception& typevar)
{
cout << "Exception: " << typevar.what() << endl;
}
return 0;
}
B. Exception:bad_alloc
C. Exception:std:bad_typeid
D. Exception:std:bad_type