1

Topic: virtual and non-virtual instance of a base class

Came across on sample c ++ test from Brainbanch
The question was such:
Which of the following statements is true when a derivation inherits both a virtual and non-virtual instance of a base class?
And the right answer
Choice 2:
Each derived class object has a base object from the virtual instance and a base object from non-virtual instance.
Still variants:
Choice 1
Each derived class object has base objects only from the non-virtual instance.
Choice 3
Each derived class object has base objects only from the virtual instance.
Choice 4
Each base class object has derived objects only from the virtual instance.
Choice 5
Each base class object has derived objects only from the non-virtual instance.
Explain please that wanted by them, in Russian?))
I and Straustrupa read Myers on , all like understood,
And here  sad

2

Re: virtual and non-virtual instance of a base class

koleso_cpp;
multiple inheritance, with the virtual base class and with not virtual - is at Stroustrup

3

Re: virtual and non-virtual instance of a base class

koleso_cpp;
The right answer: multiple inheritance should not be used (except inheritance of interfaces).

4

Re: virtual and non-virtual instance of a base class

Anatoly Moskovsky wrote:

koleso_cpp;
The right answer: multiple inheritance should not be used (except inheritance of interfaces).

It only your private wrong judgement.
Next time mark, please, with a tag #IMHIO