Re: [algogeeks] Re: VIRTUAL INHERITANCE

2011-07-06 Thread T3rminal
@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

Re: [algogeeks] Re: VIRTUAL INHERITANCE

2011-07-05 Thread oppilas .
@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

Re: [algogeeks] Re: VIRTUAL INHERITANCE

2011-07-05 Thread surender sanke
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,

Re: [algogeeks] Re: VIRTUAL INHERITANCE

2011-07-04 Thread himanshu kansal
@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

Re: [algogeeks] Re: VIRTUAL INHERITANCE

2011-07-04 Thread surender sanke
@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:

[algogeeks] Re: VIRTUAL INHERITANCE

2011-07-03 Thread himanshu kansal
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

[algogeeks] Re: VIRTUAL INHERITANCE

2011-07-03 Thread T3rminal
@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 =