@oppilas
In normal inheritance base class is not shared. Each derived class X and Y
have separate instance of base class. The whole point of virtual inheritance
is sharing so that there shall be no ambiguity as there is only one object
of base class.
--
You received this message because you
@T3rminal
Then how would you explain size of Z in case of normal inheritance(
sizeof(Z)=16
On Mon, Jul 4, 2011 at 4:08 AM, T3rminal piyush@gmail.com wrote:
@abc abc
4th class= two ints from X and Y classes + one int from base class( as
this class is shared ) + 2 virtual pointers of X and
its two ints from X and Y classes :8
2 copies of int from Base class via Class X and Class Y :8
surender
On Tue, Jul 5, 2011 at 10:39 PM, oppilas . jatka.oppimi...@gmail.comwrote:
@T3rminal
Then how would you explain size of Z in case of normal inheritance(
sizeof(Z)=16
On Mon, Jul 4,
@piyush:what does this two virtual pointers storing???nd how does they help
in eliminating ambiguity??
On Mon, Jul 4, 2011 at 4:08 AM, T3rminal piyush@gmail.com wrote:
@abc abc
4th class= two ints from X and Y classes + one int from base class( as
this class is shared ) + 2 virtual
@t3erminal u r right!!!
thanks
surender
On Mon, Jul 4, 2011 at 4:16 PM, T3rminal piyush@gmail.com wrote:
@himanshu: http://en.wikipedia.org/wiki/Virtual_inheritance
Go through the last paragraph before reference.
On Jul 4, 12:02 pm, himanshu kansal himanshukansal...@gmail.com
wrote:
1 MORE QUESHOW IS DELEGATED TO SISTER CLASS IMPLEMENTED...MEANS HOW
CAN ONE CLASS CALL ANOTHER CLASS'S FUNCTION WITHOUT KNOWING ANYTHING ABOUT
IT
On Sun, Jul 3, 2011 at 2:43 PM, himanshu kansal himanshukansal...@gmail.com
wrote:
class Base
{
public:
int a;
};
class
@abc abc
4th class= two ints from X and Y classes + one int from base class( as
this class is shared ) + 2 virtual pointers of X and Y classes.
On Jul 3, 2:24 pm, abc abc may.i.answ...@gmail.com wrote:
In the second case , the size of vptr will be added to each and every object
.
1st class =