What your teacher said falls into the “almost right” category. This probably means either of two things:
- He hasn’t got a clue what he’s talking about and is just repeating catch phrases
- He meant the right thing and there was a miscommunication somewhere.
I’m leaning strongly towards option (2) (although clueless teachers are not unheard of):
As others have said, C++ doesn’t usually come with a GC, and while it’s entirely possible to use one in C++ it’s even more unconventional to teach with one.
On the other hand, your teacher is right about the avoidance of pointers. There’s a broad consensus among members of the C++ standardisation committee, users on this very site, and other vocal experts on the internet that modern C++ makes the use of raw pointers (and in particular of manual memory management) largely unnecessary.
Traditionally, most C++ projects were littered with pointers. But raw pointers and manual memory management are error-prone, potentially inefficient (due to the introduction of indirection and cache misses) and, most importantly, they are unnecessary in modern C++.