I'm wondering whether should I make all my classes inherit from a base class, so as to be able to apply something like (garbage collection mechanism)
I'm wondering whether should I make all my classes inherit from a base class, so as to be able to apply something like (garbage collection mechanism)
C++ is not Java.
The reason to choose C++ over other languages is that it gives you fine-grained control over what your program does. If you're willing to use garbage collection, it sounds like you're willing to give that up, at which point it probably makes a lot more sense to just write your program in something like C# anyway. Which, by the way, will automatically make all your classes descend from a base class, namely System.Object.
(If you are wanting to do garbage collection but need to use C++ for some other reason, we probably need far more details about exactly what you're doing in order to advise you about the best approach.)