title: Why `this` can't access the derived class members from base class methods when called for derived class object
body: <p><code>This</code> pointer has the type of <code>ClassName</code> in non-const member functions.</p>
  
  <pre><code> class Base
   {
     public:
       void get()
       {
         //this-&gt;put(); Why can't I call back a derived class method eventhough 
                         **this** is pointing to derived class object.
       }
   };
  
   class derived: public Base
   {
     public:
     void put()
     {
      // do somthing.
     }
   };
  
   int main()
   {
    derived d;
    //d.get();
    d.put();
    return 0;
   }
  </code></pre>
  
  <p>If I print the value of <code>this</code> pointer in both the functions it is same, indicating that it is called for a derived class object. And also <code>this</code> pointers type is <code>derived *</code> here. </p>
  
  <p>Also as I understand If you have a <code>pointer</code> to object when you're calling a method of it then you're just pointing to the <code>offset</code> where the method is present in the whole <code>object layout</code> starting from the <code>address</code> present in that <code>pointer</code> to <code>object</code>. </p>
  
  <p>But why can't I offset to the <code>derived</code> class method when I have the <code>start</code> address of the <code>(derived)object</code> in <code>base</code> class method.</p>
  
  <p>I am unbale to get it why I can't do this because of the above understanding. I am missing something which is very basic here.</p>