Quantcast
Channel: How does "delete" reclaim memory? - Stack Overflow
Browsing latest articles
Browse All 4 View Live

Answer by Jesper for How does "delete" reclaim memory?

If the object that you delete has pointers to other objects or blocks of memory then no, those will not be automatically deleted if your object is deleted. You have to take care of that yourself; the...

View Article


Answer by Graham Borland for How does "delete" reclaim memory?

It's up to the definition of your destructor (not constructor).

View Article


Answer by Björn Pollex for How does "delete" reclaim memory?

The destructor is responsible for clearing up all the resources an object owns. That includes calling delete on pointers that require it. If your destructor does not do this, then you will get a memory...

View Article

How does "delete" reclaim memory?

I would like to concentrate on what happens when we say delete ptr. I know that a destructor of our class is called and then the amount of space new allocated is reclaimed.If our object has other...

View Article
Browsing latest articles
Browse All 4 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>