C++ interview question involving class pointers
- by benjamin button
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?