C++ interview question
- by benjamin button
as i am not an expert in c++,i was not aware of the answer to this question asked in one of the interviews.
lets say there is a base class pointer which is pointing to a base class object:
baseclass *bptr;
bptr= new baseclass;
now if i do
bptr= new derived;
what is the problem here?