I have this code which is supposed to cout in console the information from the .csv file;
while(file.good())
{
getline(file, ID, ',');
cout << "ID: " << ID << " " ;
getline(file, nome, ',') ;
cout << "User: " << nome << " " ;
getline(file, idade, ',') ;
cout << "Idade: " << idade << " " ;
getline(file, genero, ' ') ;
cout << "Sexo: " << genero<< " " ;
}
And a csv file that has this (when I open with notepad):
0,Filipe,19,M
1,Maria,20,F
2,Walter,60,M
Whenever I run the program the console will display this:
My question is why isn't the program repeating those cout messages in every line instead of only in the first one
Btw , nome is name, idade is age, and genero/sexo is gender, forgot to translate before creating this post