I have an assignment where I had to do a devil's dice type game and use text output to emulate the screen in the IOS game. I have that all done. Now my teacher wants a file to keep track of wins and loses. I'm at complete loss how to do this(besides using fstream. I know I need to use that but as to what's contained in the code to get my numbers, I have not a clue) Any input would be great. Thanks.
Oh yeah, and I need to have the ratio displayed in my game.
Thank you for that. Perhaps this is more specific:
I have this but it won't stay updated from the file. It pretty much starts over each time. I need to keep a running total. For example, if you enter 'q' the first time, it should store a 1 and a 0 in the file. Let's say you quit the program then run it again. If you enter 'q', I need it then to be a 2 and a 0. Same goes for the other way around.
You didn't output anything to the new file. If you want this to work, you need to read everything, then close the file. Open the file for writing, then write to the file. Close the file. You can't read and write from the same file at the same time, and you didn't even open the file for writing.