Hey guys, I'm trying to separate this list from a text file
15
Albert Einstein 52 67 63
Steve Abrew 90 86 90 93
David Nagasake 100 85 93 89
Mike Black 81 87 81 85
Andrew Van Den 90 82 95 87
Joanne Dong Nguyen 84 80 95 91
Chris Walljasper 86 100 96 89
Fred Albert 70 68
Dennis Dudley 74 79 77 81
Leo Rice 95
Fred Flinstone 73 81 78 74
Frances Dupre 82 76 79
Dave Light 89 76 91 83
Hua Tran Du 91 81 87 94
Sarah Trapp 83 98
Into Full name, so Albert Einstein, and then their following int's as an array.
However I'm not sure how to go about doing this.
This is what I have been doing so far, but it's just not clicking for me.
void Student::getData(Student * stdPtr, int len)
{
int tempt;
int sucker = 0;
ifstream fin;
fin.open("students.dat");
fin >> tempt;
while(!fin.eof())
{
string temp;
getline(fin, temp,'\n');
stringstream ss;
ss << temp;
ss >> sucker;
cout << temp << " "<< sucker << endl;
sucker = 0;
}
fin.close();
}
I feel like I'm somewhat close, with actually been able to get the numbers by themselves with the stringstream, but I don't know how to indicate to my program that I'm starting on a new student
Thanks for the help guys!