Two questions related to virtual functions
<p>I was reading this articles , was at this heading 
<a href="http://progtutorials.tripod.com/cpp2.htm#_Toc50821294" rel="nofollow">Inheritance of Base-class vPtrs</a> , but couldn't understand what did he mean in this para :</p>

<p>"However, due to multiple inheritance, a class may indirectly inherit from many classes. If we decide to merge the vtables of all the base classes into one, the vtable may become very big. <strong><em>To avoid this, instead of discarding the vPtrs and vtables of all base classes and merging all vtables into one, the compiler only does it to all the FIRST base classes, and retains the vPtrs and vtables of all the subsequent base classes and their base classes</em></strong>."</p>

<p><em><strong>In other words, in an object’s memory footprint, you can find the vPtrs of all its base classes all through the hierarchy, except for all the “first-borns”</strong>.</em> "</p>

<p>Can anyone please explain this para in simple understandable form.</p>

<p>Another question ,please have look at this answer :
<a href="http://stackoverflow.com/questions/3006766/how-to-use-the-vtable-to-determine-class-type/3006893#3006893">Follow this answer</a></p>

<p>now code of interest <code>
(*(foo)((void**)(((void**)(&amp;a))[0]))[1])();</code> , can anyone tell what is going on? , specially why does this doing exactly in c++<code>(void**)(&amp;a)</code> . i know this is casting but <code>&amp;a</code> returns the address of vptr (in the above question link 2) whose type is void* . </p>

<p>Thanks</p>
