deleting NULL pointers have no effect. deleting a pointer to a base class which points to a derived object is legal assuming the base destructor is virtual. deleting an array of objects using a base class pointer is undefined.
structBar : publicFoo
Foo* f = new Bar;
f = 0;
Foo* fa = newBar;
fa = 0;
Enter to Rename, Shift+Enter to Preview
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.