How do i possess a pawn with playercontroller?

The problem is that you’re not setting the

 AMyCustomController *MyPlayerController;
 AMyCustomPawn *MyPawn;

variables, i just put them into my code so you know their types.

If you’re new to C++ i recommend to try this first:

Then step by step learn the language