Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- class Base {
- public:
- void f() { std::cout << "Base::f()\n"; }
- };
- class Derived {
- public:
- void f() { std::cout << "Derived::f()\n"; }
- };
- int main() {
- Base* p = new Derived();
- p->f();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement