Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 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 {
  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