I've just moved from C#/Java to C++ and, as you might expect, a big problem I'm facing is understanding when to use pointers (I know that Java and C# use pointers under the hood but I never needed to understand them to program :P). I understand conceptually what pointers are but I can't seem to think of when to actually use them over just plain objects, except for perhaps arrays.
What makes it worse is that while most people on the internet say to avoid pointers when possible, whenever I read source codes for game engines and for games developed in C++, I see pointers everywhere.
For example, an excerpt from Game Programming Patterns:
int x, y;
void update(World& world, Graphics& graphics)
Why shouldn't InputComponent, PhysicsComponent, and GraphicsComponent just be objects?
I guess all I'm asking for is help understanding why and when to use pointers.
Thanks (sorry for all the text).