I do the following:
float f;
cin >> f;
On the string:
0.123W
Number 0.123 will be properly read to f
, and stream reading will be stopped on 'W'. But if we enter:
0.123E
operation will fail and cin.fail() will return true. Probably the trailing 'E' will be treated as part of scientific notation.
I've tried cin.unsetf(std::ios::scientific);
with no success.
Is there any possibility to disable treating character 'E' specially?