Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Virtual Function
- #include <stdio.h>
- #include<iostream>
- using namespace std;
- class BasicYes
- {
- public:
- virtual void show() { cout<<" In base class pointer. \n"; }
- };
- class derived: public BasicYes
- {
- public:
- void show ()
- { cout<< "In derived class" <<endl; }
- };
- int main(void)
- {
- BasicYes *bp = new derived;
- bp->show();
- return 0;
- }
Add Comment
Please, Sign In to add comment