K
kyle christian
I am trying to save the high scores of a game I made. Now Im stumped on
trying to search through the file. Should I use a string, array, or one of
the STL containers to manipulate the information read from the file?
I have tried the
stringname.find("Name");
This only returns the first occurence, and doesn't look for other
occurences.
I got better results just using
if(Name = = NewName)
The file is a simple record like so:
Name wins loses //where wins and loses are int's
Bob 1 0 //example of format
Its to be like an old Pac-Man game record keeper.
I want to convert the name into lowercase and check to make sure only one
name is present in the file. If more than one name erase the others
otherwise check to see if WinsOnFile < CurrentWins.
If so record the new high score to the appropriate name.
This will only hold 10 high scores for different people.
Any thoughts would be helpful,
thanks
trying to search through the file. Should I use a string, array, or one of
the STL containers to manipulate the information read from the file?
I have tried the
stringname.find("Name");
This only returns the first occurence, and doesn't look for other
occurences.
I got better results just using
if(Name = = NewName)
The file is a simple record like so:
Name wins loses //where wins and loses are int's
Bob 1 0 //example of format
Its to be like an old Pac-Man game record keeper.
I want to convert the name into lowercase and check to make sure only one
name is present in the file. If more than one name erase the others
otherwise check to see if WinsOnFile < CurrentWins.
If so record the new high score to the appropriate name.
This will only hold 10 high scores for different people.
Any thoughts would be helpful,
thanks