read from file to array

Hello. Sorry for my poor english.

I have a file of such data

Faculty, student name , last name , grades number, grades ..

example:

faculty john berdy 3 5 6 8
faculty John Smith 5 6 6 6 5 4
faculty just fun 2 4 2

as we see the first figure is the amount of grading, and then folow grades. How can i read it to array, because each line is different.

Then will i have the array I have to find the grade average.

Thank you for the help, really.
Easiest way would be to make a vector[1] of grades, rather than an array, because a vector can grow (and shrink) when needed. Then, it's just a matter of reading in the data (which I will leave for someone else, because I'm terrible at I/O stuff).

[1] http://www.cplusplus.com/reference/stl/vector/
Topic archived. No new replies allowed.