I wondering how to read in an unknown amount of variables from a text file. The first 2 variables of each line is always a string. After that there is an unknown amount of float or int values (at least 1 though).
For Example:
Angelina Jolie 14 67 34
Brad Pitt 12 13
Johnny Depp 2
Robert Plant 99 23 75 23 84
Bob Builder 12 13 85
How would I read that in? I'm pushing in to the back of an STL list. This is what I'm doing right now, but it doesn't accommodate more than one grade.
Question
endtype
I wondering how to read in an unknown amount of variables from a text file. The first 2 variables of each line is always a string. After that there is an unknown amount of float or int values (at least 1 though).
For Example:
Angelina Jolie 14 67 34
Brad Pitt 12 13
Johnny Depp 2
Robert Plant 99 23 75 23 84
Bob Builder 12 13 85
How would I read that in? I'm pushing in to the back of an STL list. This is what I'm doing right now, but it doesn't accommodate more than one grade.
Link to comment
Share on other sites
13 answers to this question
Recommended Posts