C++: Easy way to save a structure.

Hi. I’d like to save an array of structures from my player controller to a save game class. I could easely save other types of variables, because you can just create a variable and then transfer it. But if I create the exact same structure in the save game class, I can’t pass over the struct.
So do I have to break the struct up and send every variable alone? Because my struct is pretty big and so I’d like to have an other option. Thanks!

You don’t need to declare 2nd identical structure, just forward reference (put struct before the type) the structure in save game class and UHT and UE4 reflection system will know which structure you use, you will only need to include deceleration in cpp file when you gonna copy the data so compiler will know which structure you use, but you need to do it anyway.

Thx for the reply. But could you pls give me an example? forward reference (put struct before the type) the structure I didn’t really get this part. How do I forward reference the structure?

I tried it now many times and I don’t think I can get a solution. Could you pls send me an example?