Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class base
- {
- public:
- virtual void display(void)
- {
- cout << "basen";
- }
- };
- class derived : public base
- {
- public:
- void display(void)
- {
- cout << "derivedn";
- }
- };
- int main(void)
- {
- base *p;
- base ob1;
- derived ob2;
- p=&ob2;
- p->display();//my point starts from here
- p->base::display();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement