vagelis, I hate to be rude, but I really think your should post your questions to 'Beginners' instead of this one. Anyway, your problem in this case, is that you introduce a new integer into each derived class, instead of reusing the 'a' from 'A'. Here is what I think you meant:
kspangsege, you are wrong - this not ridiculously simple and you are wrong - this has nothing to do with additional variables.
vagelis, you may want to read http://www.parashift.com/c++-faq-lite/multiple-inheritance.html#faq-25.11 and bellow. The key sentence is "there are special rules to make sure the virtual base class's constructor and destructor get called exactly once per instance". Since D() called A(), C() will not call A(1).
by the way, mistakes in your code: main must be int and return 0, ( void ) is only needed in C, you don't need a ; after defining a constructor (like any other function), instead of using cin >> integer for pausing, which is .. odd, use cin.get() if you don't use cin >> anywhre in your code, or cin.ignore().get() if you do.
"there are special rules to make sure the virtual base class's constructor and destructor get called exactly once per instance". Since D() called A(), C() will not call A(1).
ok i thought also that the answer would be somthing like this..
but i didnt know the answer and so i asked..
i dont have problem to ask in beginners because i am
but i think the questions are not so simple
If a class A inherits multiple times and virtually from a class B, then A must call B's constructor directly, so if you do not write an explicit call to B's constructor, the default constructor, that takes no arguments, will be called.
When a class A inherits multiple times from a class B, and the inheritance is not virtual, then A actually contains B multiple times, and therefore, in this case, B's constructor will be called multiple times - once for each instance.