C++ Programming Test

    Welcome to your C++ Programming Test

    1. Run time type identification comes at a cost of performance penalty.
    2. Which of the following statement is not correct about function overiding?
    3. What will be the output of following code? #include using namespace std; class Base { public: void show() { cout << "Base"; } }; class Derived:public Base { public: void show() { cout << "Derived"; } }; int main() { Base* b; Derived d; b = &d; b->show(); return 0; }
    4. Virtual Keyword is used to make a member function of the _________ class Virtual?
    5. Choose the correct statement?
    6. Which of the following is a correct way to declare Pure Virtual function?
    7. What will be the output of following code? #include using namespace std; class Base { public: ~Base() {cout << "Base Destructor"; } }; class Derived:public Base { public: ~Derived() { cout<< "Derived Destructor"; } }; int main() { Base* b = new Derived; delete b; return 0; }
    8. Pure Virtual Destructors also exist in C++?
    9. The address of the virtual Function is placed in the _________ .
    10. Constructors can also be Virtual. True or False?
    11. Which feature allows you to create a Derived class that inherits properties from more than one Base class?
    12. Which feature in Object Oriented Programming allows reusing code?
    13. A function that changes the state of the cout object is called _______?
    14. What does C++ append to the end of a string literal constant?
    15. An array element is accessed using _______ .