title: What is dynamic type of object
body: <p>What i think is that dynamic type means dynamically allocated object using <code>new</code>. In the following case, do you say <code>p</code> points to dynamic type or static type of object? In standard, it doesn't say about dynamic type being dynamic object.</p>
  
  <blockquote>
    <p>1.3.3 - The type of the most derived object (1.8) to which the lvalue denoted
    by an lvalue expression refers. [Example: if a pointer (8.3.1) p whose
    static type is "pointer to class B" is pointing to an object of class
    D, derived from B (clause 10), the dynamic type of the expression *p
    is "D." References (8.3.2) are treated similarly. ]</p>
  </blockquote>
  
  <p>Also what does it the following quote mean </p>
  
  <blockquote>
    <p>The dynamic type of an rvalue expression is its static type</p>
  </blockquote>
  
  <pre><code>class Base {
      virtual void foo(){}
  };
  
  class Derived : public Base {
      void foo(){}
  };
  
  int main()
  {
      Derived d;
      Base *p = &amp;d;
  }
  </code></pre>