Paste Search Dynamic
Recent pastes
base bp new Derived
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. class Base
  5. {
  6. public:
  7.     void show() { cout<<"Base"; }
  8. };
  9.  
  10. class Derived: public Base
  11. {
  12. public:
  13.     void show() { cout<<"Derived"; }
  14. };
  15.  
  16. int main()
  17. {
  18.     Base *bp = new Derived;
  19.     bp->show();  
  20.     return 0;
  21. }
Parsed in 0.002 seconds