
Dynamic Type Versus Static Type
The type of the most derived object to which an expression refers is said to be the dynamic type of that expression. For example, if p is declared as a pointer to class B and it’s actually pointing to an object of class D (when D is derived from B),