now here when the objects d(1,2,3) is created. then constructor of D will be called. in that as the class c is initalized first so it will get called but how it gets the value of int a. i am not the getting the flow of the programme. Please help me to understand.

Thanks

11-13-2009

xbuilder

Would you understand a simpler example?

How about:

Code:

int main()
{
A a1(10);
return 0;
}

Then:

Code:

int main()
{
B b(1, 10);
return 0;
}

If you don't understand these, we need to step back a bit.

11-13-2009

m37h0d

he's confused by the order of construction in multiple inheritance.

they are constructed the order in which you declare the inheritance chain that determines the order of construction. i.e. you have: "public C, public B" (the class keyword is superfluous here), so the C inheritance branch is constructed, then the B branch