Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Base
- {
- public:
- virtual void foo() const
- { cout << "In Base::foon"; }
- }
- class Derived : public Base
- {public:
- virtual void foo()
- { cout << "In Derived::foon"; }
- };
- void main()
- {Base* b = new Derived();b->foo();
- delete b;
- }
- In Derived::foo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement