Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <iostream>
  2. #include <unordered_map>
  3. #include <string>
  4. #include <vector>
  5. #include <cstring>
  6. #include <memory>
  7. #include <algorithm>
  8. #include <map>
  9.  
  10. using namespace std;
  11.  
  12. class A {
  13. public:
  14.     A() {
  15.         cout << "A()" << endl;
  16.     }
  17.  
  18.     ~A() {
  19.         cout << "~A()" << endl;
  20.     }
  21. };
  22.  
  23. class B: public A {
  24. public:
  25.     B(){
  26.         cout << "B()" << endl;
  27.     };
  28.  
  29.     ~B() {
  30.         cout << "~B()" << endl;
  31.     }
  32. };
  33.  
  34. class C: public B {
  35. public:
  36.     C() {
  37.         cout << "C()" << endl;
  38.     }
  39.  
  40.     ~C() {
  41.         cout << "~C()" << endl;
  42.     }
  43. };
  44.  
  45. int main() {
  46.     C c;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement