Functions and OOP Features - user-defined functions, parameter passing, virtual functions, constructors, destructors, overloading, templates - Online Test
30:00
1. What is the primary purpose of a user-defined function in programming?
2. Which parameter passing mechanism allows a function to modify the original variable passed to it?
3. In C++, what is a virtual function primarily used for?
4. What is the main role of a constructor in object-oriented programming?
5. Which member function is automatically called when an object of a class is destroyed?
6. Function overloading allows multiple functions with the same name to exist if they differ in:
7. What is the purpose of a template in C++?
8. When a variable is passed by value to a function, any changes made to the parameter inside the function:
9. Consider a base class `Animal` and a derived class `Dog`. If `speak()` is a virtual function in `Animal` and is overridden in `Dog`, calling `speak()` on a `Dog` object through a pointer to `Animal` will invoke:
10. A constructor that takes no arguments or has default values for all its arguments is known as a:
Test Results
0/0