basic c++ polymorphism question
Posted on 2013-05-14
I have a tree of different kinds of objects. i.e., the child nodes of higher level parents are of different types. However, they all implement a similar interface - ISomething.
If I delete any of the objects by using the interface pointer like this:
delete (ISomething*) theObject;
Am I also safely deleting the underlying full object? I think not.
Thanks for confirming,