I'm also a beginner. As far as I know, you must use cheat engine to change the values. C++ is mainly used for creating a application of a hack you already found. If you are new to using Cheat Engine 6.3, I recommend watching some tutorials. They helped me a lot.
But basically, you must find the address of the thing you want to change. So to change XP, you need to change the value.
I haven't figured it out yet, but I believe the max value is 4805. That may help you narrow it down.
Best of luck