Which way is better? So, for example, let's say we have a game engine class through which you can add objects. But object manager class does that. So should I put it as it's member or inheritance it?
A member. Especially in C++ and other statically typed languages.
(Should we be able to substitute an object of type Engine where an object of type ObjectManager is expected?)
If you must use inheritance (less boiler plate code to write if Engine must reuse, and expose in its interface, a lot of the functionality of ObjectManager), use private inheritance (ie. inheritance without substitutability).
As far as I know, inheritance represents an is-a relation. In this case, I wouldn't use inheritance, as I see no logican explanation for having an ObjectManager as a parent for an Engine.