class A: public B, public C { };
In this case, the execution order:
B();
C();
A();
class A: public B, virtual public C { };
But in this case, when I write virtual with class c when inheriting, the order
C();
B();
A();
I read somewhere that the order in which the constructor is called depends on the order of the declaration when several classes are inherited, but how the execution order changes when writing the virtual with the class. I can’t get why I get such a result.
source
share