Garbage collection

A garbage collector is a separate module usually incorporated in the runtime environments of interpretable languages. For example, C# and Java both have garbage collectors, which makes the life of programmers a lot easier. The garbage collector tracks all the object allocations in the code and deallocates once they are not in use anymore. It's called a garbage collector because it deletes the memory resource after it's been used: it collects the garbage left by programmers.

It's said that C++ programmers don't leave garbage after them, that's why the language doesn't have support for a garbage collector. Though programmers tend to defend the language stating that it doesn't have a garbage collector because it's a fast language, ...

Get Expert C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.