Vidyalelo
C++ Programming · Q722

C++ miscellaneous

Programming · C++ Programming · question 722

Q722

What will be the output of the following C++ code? #include #include #include 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;

A.
NULL
B.
Exception:bad_alloc
C.
Exception:std:bad_typeid
Answer
D.
Exception:std:bad_type

Answer: Option C

Solution

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