InterviewSolution
Saved Bookmarks
| 1. |
Predict output of the following program#include<iostream>using namespace std;class Base{public:virtual void show() { cout<<" In Base \n"; }};class Derived: public Base{public:void show() { cout<<"In Derived \n"; }};int main(void){Base *bp = new Derived;bp->show();Base &br = *bp;br.show();return 0;}(A)In Base In Base (B)In Base In Derived(C)In DerivedIn Derived(D)In DerivedIn Base |
| Answer» | |