How to spawn and control a second player using C++

I’ve been browsing the forums for a couple of days and I can only find blueprint related ways of going about this however I’m trying to make my game solely in C++. Can anyone help answer this question or point me in the right direction?

In fact thats the same function used in blueprint to create new player, the control of that player will be set up by player controller class, which will be spawned for that player.

Search API Reference for blueprint equivalents ;]