I have a file:
a 0 0
b 1 1
c 3 4
d 5 6
Using istringstream, I need to get a, then b, then c, etc. But I do not know how to do this, because there are no good examples on the Internet or in my book.
Code so far:
ifstream file;
file.open("file.txt");
string line;
getline(file,line);
istringstream iss(line);
iss >> id;
getline(file,line);
iss >> id;
Prints "a" for id at the same time. I do not know how to use istringstream, and I have to use istringstream. Please, help!
source
share