When I do, I get the following error: Invalid operends to binary expression ('if stream' (aka 'basic_ifstream<char>') and 'int')
savefile << player.health
Type: Posts; User: Vanillla
When I do, I get the following error: Invalid operends to binary expression ('if stream' (aka 'basic_ifstream<char>') and 'int')
savefile << player.health
The executable, data.txt, and the main.cpp, are all in the same file, but the data.txt file is still being created in Macintosh HD\Users\MyUser
I only put 's' in front of all the variables is...
So, it is saving to a file, but not the file where the main.cpp is, so would that mean I would have to add the directory to the file?
With the struct is it possible for me to input variables from my main.cpp?
It is not adding anything at all, so when I open the document data.txt, it is blank
Whoops, sorry about that, did the wrong code, the above one does work, I think I might have too many variables but I am not sure
void gamesave(string sslimychestplate, string sslimyhelmet, string...
I did put it in those tags. It must not show up.
Anyways, the strings are numbers ex: "1", "109", which get the data from integers. So I convert the int value into a string, so it always has a value...
I have a code but the problem is that it isn't putting the desired text to a text file. I have to have it in a function, can't have it in main. I do include stream, upstream, string, etc.
void...