C++ Get Game Mode

Hello everyone, I am currently trying to convert a blueprint project into C++ code and got stuck trying to get the game mode and cast it as an object reference in C++.

The image below is the current blueprint implementation of casting and getting the game mode.

This image below shows my attempt in trying the get the game mode in the same way but not sure what is the exact input, syntax, or includes which I need in order to successfully obtain the game mode similar with the blueprint.

Any help and suggestions is appreciated.