HOW MANY INSTANCES OF THE VIRTUAL BASE CLASS WILL BE CRAETED IN THE BOTTOM CLASS.
a is BASE CLASS class a
b and c are DERIVED CLASSES class b and class c
d is DERIVED DERIVED CLASS class d
class a
{
};
class b: public a
{
};
class c:public a
{
};
class d: public b ,public c
{
}
So How many Instances of class a are present in class d. Is there any way to change the number of Instances
Comments
:
: a is BASE CLASS class a
: b and c are DERIVED CLASSES class b and class c
: d is DERIVED DERIVED CLASS class d
:
: class a
: {
: };
: class b: public a
: {
: };
: class c:public a
: {
: };
:
: class d: public b ,public c
: {
: }
: So How many Instances of class a are present in class d.
Count them - one of each, both contain 1 a - therefore 2 right?
: Is there any way to change the number of Instances
Rewrite the code?
C++ is case sensitive
And so are we - http://www.tuxedo.org/~esr/faqs/smart-questions.html#writewell
Kind Regards
Konrad
----------------------------
(+46/0) 708-70 73 92
[email protected]
http://konrads.webbsida.com