title: Virtual tables and virtual pointers for multiple virtual inheritance and type casting
body: <p>I am little confused about vptr and representation of objects in the memory, and hope you can help me understand the matter better.</p>
  
  <ol>
  <li><p>Consider <code>B</code> inherits from <code>A</code> and both define virtual functions <code>f()</code>. From what I learned the representation of an object of class B in the memory looks like this:<code>[ vptr | A | B ]</code>
  and the <code>vtbl</code> that <code>vptr</code> points to contains <code>B::f()</code>. I also understood that casting the object from <code>B</code> to <code>A</code> does nothing except ignoring the <code>B</code> part at the end of the object. Is it true? Doesn't this behavior is wrong? We want that object of type <code>A</code> to execute <code>A::f()</code> method and not <code>B::f()</code>.</p></li>
  <li><p>Are there a number of <code>vtables</code> in the system as the number of classes?</p></li>
  <li><p>How will a <code>vtable</code> of class that inherits from two or more classes look like? How will the object of C be represented in the memory?</p></li>
  <li><p>Same as question 3 but with virtual inheritance.</p></li>
  </ol>