C++ does not have built-in garbage collection, but it does have the C++ Standard Template Library (STL). STL provides a garbage collector that can be used to manage memory automatically. To use the garbage collector, you must include the header file and use the std::shared_ptr class. You can then use the shared_ptr to manage the memory for you. For more information about the garbage collector and how to use it, you can reference the C++ Standard Library documentation.