title: What happens when calling base functions from derived classes?
body: <p>Well my question is a bit trickier.
  Let's say I have three classes like so:</p>
  
  <pre><code>    class GrandFather
      {
      public:
          virtual int DoSomething()
          {
              return 3;
          }   
      };
  
      class Father : public GrandFather
      {
      };
  
      class Child : public Father
      {
      public:
          virtual int DoSomething()
          {
              Father::DoSomething();      
          }   
      };
  </code></pre>
  
  <p>I have found in some references, that when calling a base function, the whole virtual mechanism isn't used, and name mangling takes place.</p>
  
  <p>Now I want to know how this could be done.</p>
  
  <p>The Child class has a pointer to its own vtable, which will indicate that upon calling <code>DoSomething()</code> the implementation of the child is called. </p>
  
  <p>The Father class has a pointer to its own vtable as well, which will indicate that upon calling <code>DoSomething()</code> the implementation of GrandFather is called.</p>
  
  <p>When I use <code>Father::DoSomething()</code> inside of Child, it should call <code>GrandFather::DoSomething()</code>,
  but how can Child tell where the function is?</p>
  
  <p>If name mangling is really used, then how? because there is no function with that name (something like <code>_Father_DoSomething(this)</code>).</p>
  
  <p>Child must access the Father's vptr in order to get to <code>GrandFather::DoSomething()</code> , which as much as I know, he cannot.</p>
  
  <p>This has been bothering me for quite some time, so I will appreciate the help very much.
  thanks :)</p>