Guest User

Untitled

a guest
Nov 24th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2. struct A
  3. {
  4. A() { std::cout << "A" << ++x; }
  5. A(int x) : A() { std::cout << x; }
  6. ~A() { std::cout << "D"; }
  7. static int x;
  8. };
  9.  
  10. int A::x = 0;
  11. struct B
  12. {
  13. A a, aa, aaa;
  14. B() : aa(1), a(2) { std::cout << "B" << std::endl; }
  15. ~B() { std::cout << "B" << A::x; }
  16. };
  17. B beta;
  18.  
  19. int main()
  20. {
  21. return 0;
  22. }
Add Comment
Please, Sign In to add comment