I'm reading with my c++ program csv file:
abc;def;ghi
10;;10
by this code:
while(getline(in, str, '\n')){
stringstream ss;
while(getline(ss, str, ';')){
line.add(str);
}
}
Where in is input file, str
is string variable and line is my collection (like vector
). But getline
jumped over the empty string in csv file.
Can anyone help me to reading empty string, too?
Thanks :)