title: Downcasting using the 'static_cast' in C++
body: <p>Consider:</p>
  
  <pre><code>class base
  {
      base();
      virtual void func();
  }
  
  class derived : public base
  {
      derived();
      void func();
      void func_d();
      int a;
  }
  
  
  main
  {
      base *b = new base();
      sizeof(*b); // Gives 4.
      derived * d = static_cast&lt;derived*&gt;(b);
      sizeof(*d); // Gives 8- means whole derived obj size..why?
      d-&gt;func_d();
  }
  </code></pre>
  
  <p>In the above code I did downcasting of a base pointer which points to base object to derived class pointer. I am wondering how the derived pointer has the whole derived class object. I can call the derived class function (declared in derived class only). I did not get the concept here.</p>