string tmp("f 1/2/3 4/5/6 7/8/9");
istringstream stin(tmp);
string token;
char ch;
int a,b,c,e;
stin >> token;
while(stin){
stin >> a >> ch >> b >> ch >>c;
cout <<a << " "<<b <<" "<<c << endl;
}
Why the output is 1 2 3 4 5 6 7 8 9 7 8 9 But why for changing while(stin) to while(!stin.eof()) the output is
- 1 2 3 4 5 6 7 8 9
So what is the difference between while(stin) to while(!stin.eof()) Thanks a lot!