Constructor destructor invocation:-

What will be the order of constructor and destructor invocation in the following piece of code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class A
{…};
class B
{….};
Class C
{ 
   B b;
   A a;
};
void main()
{
   A x;
   C y;
   B z;
}
http://www.gotw.ca/gotw/080.htm

Destruction is reverse.
Topic archived. No new replies allowed.