Lines 9 and 10 in the Player_Class header file are incorrect. If they are member functions, you forgot the return type, and if they are friends, you also forgot to prepend them with the
friend
keyword.
Now, I can understand why you'd want these two functions to access the private and protected variables. From your last post, however, you seem to think you need to create temporary objects (which would make no sense in the case of SaveGame) before doing anything.
As I have mentioned in one of my earlier post and have shown in my examples, pass the objects as parameters.
1 2
|
void SaveGame(const Player&, const Customer&, const Bank&);
void LoadGame(Player&, Customer&, Bank&);
|
Then use what member functions you provide to write your save data in SaveGame().
The member functions you'll be using in SaveGame() will probably be functions you'll also use in other parts of your program anyway. For example, displaying player experience and money, displaying how much money is in the bank, or displaying customer names.
LoadGame() especially has no need to access any of the data variables. It'd just read information from the file, convert it to the appropriate variable types, then pass it to the class constructor to create that state (which you haven't written yet).
Side Note:
I'm not sure if your Customer class should be holding a container of people when it sounds like it should be one person.