Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. class Base {
  4. public:
  5.   void f() { std::cout << "Base::f()\n"; }
  6. };
  7.  
  8. class Derived : public Base {
  9. public:
  10.   void f() { std::cout << "Derived::f()\n"; }
  11. };
  12.  
  13. int main() {
  14.   Base* p = new Derived();
  15.   p->f();
  16.   return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement