Procedure 1

The results

Why a is initialized to 1 of class D object obj, rather than constructor in the class B default constructor in 2 or class D the default of 100?
Program 2

The results

CodePudding user response:
Virtual inheritance, there is only one base class A, not B or C, so you need to function in the construction of the D initialization list, specify A constructor,CodePudding user response:
