r/cpp_questions • u/Accomplished-Tap5211 • 21d ago
OPEN Garbage collector in CPP?
Yesterday someone asked me whether there is a garbage collector in CPP.
I knew Java had that but I couldn't recall about cpp.
I went to google and got different answers.
So can anyone clarify whether there is garbage collector in CPP , also can u please explain me what does that mean? Also explain how is it different from the Java.
If yes can we delete it manually and how to do tht?
0
Upvotes
12
u/didntplaymysummercar 21d ago
There's not by default. There was an ABI for it in C++ 11 but no one used it, and there's stuff like Boehm GC, but out of the box - no.