What is the output of the following program?
#include <iostream> using namespace std;
class Base { public: void fun() { cout << “Base Class” << endl; } }; class Derived : public Base { public: void fun() { cout << “Derived Class” << endl; } }; int main() { Derived objD; Base *ptrB = &objD; ptrB->fun(); }
Reveal answer
Fill a bubble to check yourself