Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. class Base
  2. {
  3. public:
  4. virtual void foo() const
  5. { cout << "In Base::foon"; }
  6. }
  7.  
  8. class Derived : public Base
  9. {public:
  10. virtual void foo()
  11. { cout << "In Derived::foon"; }
  12. };
  13.  
  14. void main()
  15. {Base* b = new Derived();b->foo();
  16. delete b;
  17. }
  18.  
  19. In Derived::foo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement