title: Pointer to base class sub-object. Which version of virtual function is invoked?
body: <p>In <code>dynamic binding</code>, the function call is bound to the function implementation based on the type of object to which the pointer is pointing to.</p>
  
  <p>Suppose we have the following code :</p>
  
  <pre><code>base *bptr = new derived;
  bptr-&gt;func();
  </code></pre>
  
  <p>Let the function <code>func</code> be declared virtual in the base class. Then the derived class's version of virtual function <code>func</code> will be invoked at run-time due to dynamic binding. </p>
  
  <p>I understand the above concept.</p>
  
  <p>But i got confused by the following concept which i studied after studying the above concept.</p>
  
  <p>In the above code snippet, a pointer to derived class object is implicitly converted to a pointer to base class object. Then <code>bptr</code> will be actually pointing to the base class sub-object of derived class object and not pointing to the derived class object.</p>
  
  <p>Since the base class pointer <code>bptr</code> is pointing to base class sub-object, during run-time shouldn't the base class's version of virtual function <code>func</code> be invoked?</p>