Hey guys, I want to calculate the amount of attendance of yes and no of each student from csv.file. Can anyone help me on how to extract the each string to calculate with for loop? Here is my code: Code: void task1(){ string line,token; ifstream fin("Data.csv"); string attendance[10]; int i=0; if (fin.is_open()){ while (getline(fin, line)){ stringstream ss(line); for (i = 0; i < 10; i++){ getline(ss, token, ','); attendance = (token.c_str()); } cout << "Attendance: "; for (i = 0; i < 10; i++){ cout << attendance << " "; } } fin.close(); cout<<endl; }else{cout << "Couldn't open the file \n" << endl; fin.close();} } File: [Data.csv] yes, yes, yes, no, yes, yes, no, no, no, yes (student 1) no, yes, yes, no, yes, yes, yes, yes, no, yes (student 2) yes, yes, yes, no, yes, yes, no, no, no, yes (student 3) yes, 1, yes, no, yes, yes, no, yes, no, yes (student 4)