line 2: You are creating variable line of type std::string (why not inside loop? Looks like it belongs there)
line 3: A loop for all players
line 5: you are reading line from file into array of strings with index corresponding of current player.
line 6: You are creating a stringstream variable. It works like any other stream
line 7: You are outputting value of arr[i] (or a line we get from a file before, actually) so our stringstream contains that string now.\
line 9: we are reading characters from val to the first encountered ';'
line 10: we are assigning to the integer member variable of some struct placed in a gamers array value of integer contained in line now. (And wy didn't they used stoi(line)?)
create a structure called Record, add to this member variables that match your column headers (num, name, age etc etc).
Create an array of these records
in your for loop:
- new up a record
- when you get each line from the file parse it and populate each of the member variables (looks likeit's space separated variables?).
- add this record to your array.
so when the for loop completes you'll have a populated array of Records.