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?
The obvious answer is that you're leaking the original base class object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With