Home / MCQ Bank / Computer
Computer Inheritance In C Plus Plus Difficulty: Medium

What is a virtual function in C++?

Select the correct option to test your answer:

More Computer Questions

If you select Insert > Picture > From File . . . . . . . . chat is a text-based chat system for instant messaging. What is the purpose of a "hash collision resolution" technique? What will be the result of the following MySQL command? WHERE end_date IS NULL AND (title='teller' OR start_date < '2007-01-01') What will be the output of the following C++ code? #include <iostream> using namespace std; class BaseClass { int x; public: void setx(int n) { x = n; } void showx() { cout << x ; } }; class DerivedClass : private BaseClass { int y; public: void setxy(int n, int m) { setx(n); y = m; } void showxy() { showx(); cout << y << '\n'; } }; int main() { DerivedClass ob; ob.setxy(10, 20); ob.showxy(); return 0; }