class B : public A { };
A* p1 = new B;
B* p2 = new A;
, , 1 2. 2?
class B class A, - - - , , A, , . B , , , A. -, A , B, , - virtual. , .
, , >= .
A* p1 = new B;
- B / , p1. B , A, - - - , B* A*.
B* p2 = new A;
A, , B . ( ) - . (, p2 = (B *) ( A) ) to treat the memory address in p2 as if it were an B , then it may later try to access additional data it expects to be part of any B which simply doesn't exist in any A`: , ..