Does C++ has automatic garbage collection mechanism, where all the resources allocated for an object will be cleaned automatically by Garbage Collector once the object gets destructed?
No, C++ doesn't have automatic garbage collection. It is the programmers duty to clean all the memory allocated. Note: By default once an application ends memory and resources allocated will be freed by O.S.
Back To Top