What is the output of following program?


			  		

Loading

Practice Objects and Classes –

What is the output of following program?

#include<iostream>
using namespace std;

class Base
{
public:
virtual void show() { cout<<" In Base "; }
};

class Derived: public Base
{
public:
void show() { cout<<"In Derived "; }
};

int main(void)
{
Base *bp = new Derived;
bp->show();

Base &br = *bp;
br.show();

return 0;
}