samedi 18 avril 2015

an extra value being printed? how to get rid of it?

i am reading from .csv file and then mapping the data into a map. but an extra value is being printer again and again. how do i get rid of it?


while ( istream! = 0) {


string a;


getline (istream , a , ',' );//delimiting


int num = 0;


istream >> num;


cout << a << " ";


cout << num << endl ;// extra 0 being printed here


input[a] = num ;// values being stored in a map


}


Aucun commentaire:

Enregistrer un commentaire