Store gameplay data?

Hi,
I am trying to store the coordinates of characters at different intervals in some sort of data source. Which I can export as a csv file then. What is the best approach to do so in C++?

In generally, you might store properties using these classes;

1 - Save Game Object

2 - Game Instance

1 - Save Game Object

This class just save/load object that you can write/read some data members on your specified USaveGame class.
For more information you might read docs: Saving Your Game with C++

2 - Game Instance

Roughly speaking, the game instance is a singleton class that persistent data between levels and execution of a program. This class runs when the game started and will be persistent in the memory until game is closed.