If A is the base class and B is a class derived from A, and x and y are pointers to objects of A and B, respectively, which assignment statement can pass the compiler check?

If A is the base class and B is a class derived from A, and x and y are pointers to objects of A and B, respectively, which assignment statement can pass the compiler check?


Answers:


A.
y = x;

B.
x = y;

C.
B = A;

D.
A = B;

Answer. B.