When you assign a pointer of D to an pointer of Class A you are implicitly casting a D object to one of Class A thus you are striping the B Part of the inheritance and some of the functionality of Class D.

Implicit cast:
Code:
A* pA = pD;
you should always try to minimize casting especially with inheritance because it can lead you to a bunch of trouble

if you use the first object and do this:
Code:
D* pD = new D;
pD->draw();
the compiler will give you an error and will say that draw is ambiguous, it has no way to decide which function to call
the solution for that is to specify the class with the scope resolution operator
something like this:
Code:
pD->A::draw();