Home / MCQ Bank / Computer
Computer Plus Plus Miscellaneous

What will be the output of the following C++ code? #include <iostream> #include <typeinfo> #include <exception> using namespace std; class base { virtual void f(){} }; class derived : public base {}; int main () { try { base* a = new base; base* b = new derived; cout << typeid(*a).name() <v '\t'; cout << typeid(*b).name(); } catch (exception& e) { cout << "Exception: " << e.what() << endl; } return 0; }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C • 4base and 7derived

Related Computer Questions

Relative URLs are used to ______ The boxes that are displayed to indicate that the text, pictures or objects are placed in it is called____________? How do you install a package in R from the CRAN repository using the install.packages() function? Text boundary can be displayed or hidden from The _______________ is the result of taking the computed value and completing any remaining calculations to make it the absolute theoretical value used in the layout of the document.