Advertisement
abuzuhair

Untitled

Aug 15th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. class Base
  4. {
  5. public:
  6.     Base()
  7.     {
  8.         std::cout << "Base()\n";
  9.     }
  10.     ~Base()
  11.     {
  12.         std::cout << "~Base()\n";
  13.     }
  14. };
  15.  
  16. class Derived: public Base
  17. {
  18. public:
  19.     Derived()
  20.     {
  21.         std::cout << "Derived()\n";
  22.     }
  23.     ~Derived()
  24.     {
  25.         std::cout << "~Derived()\n";
  26.     }
  27. };
  28.  
  29. int main()
  30. {
  31.     Derived d;
  32.     Base b;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement