I am trying to read user setting from a file and need to be able to read the name and the settings.
The text file layout would be like this UserName set1,set2,set3,set4,set5
Example File:
Bill 50,10,10,20,10
Mike 25,25,5,15,30
What i would like to be able to do is set an int array to the values of the profile that was selected.
1 2 3 4
// Example: Mike is selected
for(int i=0; i<5; i++){
settings[i] = *number from file*
}
I was thinking i could use string::find or maybe strcmp as i found those from other posts but i am unsure if either of those are what i am looking for.
Thats the idea but you messed up a little in line 4.
You will be filling settings with "mike".
after line 2, you will scan 5 integers from the file to settings.