comma as fill-character in istringstream
Felix Natter
f.natter@ndh.net
Sat Apr 1 00:00:00 GMT 2000
hi,
when using an istringstream to parse an expression like "<int>,<int>",
I am having problems (that did not show up with the libstdc++ supplied
with egcs-1.1.1, although it was istrstream by then):
string arg("2,3");
istringstream istr(arg);
int num, den;
istr.fill(',');
istr >> num;
istr.ignore();
istr >> den;
here, num ends up as 23, and den is undefined (as far as I can tell,
large number)
the same thing happens if I leave out the istr.fill, so maybe "," is
ignored as a fill character ? I could imagine that this is related to
localization (i.e. in German, 1.2 is spelled "1,2")
I am using libstdc++-2.90.7
--
Felix Natter
More information about the Libstdc++
mailing list