Is there a quick and/or easy way to save a class to a file/disk?
For example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
class Player
{
public:
Player(string name);
~Player(){};
//---functions left out---
private:
double myLoca;
int stat[200];
short hand[30];
short head[30];
short body[30];
short feet[30];
bool trea[100];
bool cond[10];
short quest[100];
string myName;
float myAdren;
}
How could I save the data used in this class?
I've worked some with "ofstream", but it doesn't work.