1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
{
string assessment, read;
int count=0, value;
getline(fin, read , ',' ); // this works fine: 'read' now equals 'Q1' as it should.
while( count != 36 ){
getline(fin, assessment , ',' ); //this works fine: 'assessment' now equals '2' as it should.
fin >> assessment; // assessment still = '2' at this point
istringstream iss(assessment); //problem!!!!!!!!!!!!!!
//assessment now equals '8,5,1,10,5,9,9,3,5,6,6,2,8,2,2,6,3,8,7,2,5,3,4,3,3,2,7,9,6,8,7,2,9,10,3' , it should still be '2'... what happened?!?
iss >> value;
scores[count] = value;
count++;
}
return read;
}
|