As stated in the title, here is my code:
class Foo { public: Foo (int charSize) { str = new char[charSize]; } ~Foo (
Calling a destructor releases the resources owned by the object, but it does not release the memory allocated to the object itself. The second code snippet has a memory leak.