Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- struct A
- {
- A() { std::cout << "A" << ++x; }
- A(int x) : A() { std::cout << x; }
- ~A() { std::cout << "D"; }
- static int x;
- };
- int A::x = 0;
- struct B
- {
- A a, aa, aaa;
- B() : aa(1), a(2) { std::cout << "B" << std::endl; }
- ~B() { std::cout << "B" << A::x; }
- };
- B beta;
- int main()
- {
- return 0;
- }
Add Comment
Please, Sign In to add comment