Hello all.
I have this code here that is supposed to save all the values in a file, and it does that in vSave().
Also, you can load the values with vLoad().
vSave works just fine.
But when i try to load it via vLoad, it only loads the first couple variables, and I have no idea why.
There are several things I would point out are not so nice:
1.Is your save.dat a binary file? My guess is that is an ascii file. You input aMap, than an endl. Then you read aMap, then bAdmin. In a binary file, you need to account for the endl as well.
2.I don't understand the logic of the while loop. Why do you need it?
3. It seems to me that saveName, aMap, badmin, and so on are global variables. That is a bad habit. Try not to use global variables unless you really need to.
the loop was just a long way of doing this.
I just dont understand why the old one didnt work. Oh well.
Also, why is it bad practice to use global variables? Im not writing anything tat anyone else will use(probably)