question about text fies

is ther a way to insert all the words from a text file into string array and the integers to int array?

i tried somthing like:

1
2
3
4
5
6
7
8
9
10
string line[50];
int arr[50]
i=0;
while (!myfile.eof())
{
getline(myfile,line);
stringstream(line)>>line[i];
stringstream(line[i])>>score[i];
i++;
}



but its not even close to be working...


this is my text file:

Register Teams
New-York Knicks
Chicago Bulls
Utah Jazz
LA Lakers
;
> Game 1, Oct. 20, 2013
Chicago Bulls - Utah Jazz 98-103 (51-50)
LA Lakers - New-York Knicks 91-88 (51-50)
;
> Game 2, Oct. 27, 2013
Chicago Bulls - LA Lakers 90-83 (63-47)
Utah Jazz - New-York Knicks 90-98 (63-51)
;


Last edited on
Topic archived. No new replies allowed.