I would suggest that the newsgroup .stl may be a good place to ask this, as P.J.Plauger of Dinkumware often monitors the posts and replies to many which concern their implementation. It can be parsed as negative binary value, negative octal value, blah blah blah, but it IMO cannot be parsed as unary value (yup, there exists a numeric base of one!) or positive value at any base (for nitpickers: not taking locale nor custom numeric extractors into account). decimal string representation "-10" ("minus" character, "one digit" character, "zero digit" character), which is not a number, and has to be parsed with some rules (radix, locale, format, etc) to form (be converted to) a number. integral value -10 ("negative ten"), which can be assigned to unsigned variable as stated in standard, resulting in unsigned value with bit pattern identical to given, and which is NOT a matter of this problem, and Please, anyone who is going to post next about signed-to-unsigned conversion, please make sure that you can distinguish between: Cheers, Maciekīelloc, you confuse two concepts: value, and string representation of a number in decimal base.
![pj plauger standard c library pj plauger standard c library](https://europepmc.org/articles/PMC7006409/bin/13321_2020_415_Figc_HTML.jpg)
Please tell me whether it is a bug, a hole in the standard (which I doubt), or I understand something wrong. But in this case I think that library behaviour does not follow rules given by standard, since int parsers are not able to read strings representing unsigned int values, as range of first does not fully contain a range of second. when reading signed short value, strip leading '-' character and read it with utilities used to parse unsigned int value).
#PJ PLAUGER STANDARD C LIBRARY ISO#
I know that ISO IEC 14882 states that library may delegate parsing to utilities which parse wider-range values (i.e. Invalid number formatNote that I am trying to read unsigned int value, and that user enters minus character, which, I believe, is inconsistent with unsigned number format. Number read: 4294967286 Output I'd expect (and given by G++): Output I get after compiling with MSVC 2008 EE (bold characters are entered by user): Now I wonder, is it some kind of bug, or I understand C++ rules wrong? Problem: formatted input operators for unsigned built-in data types allow strings representing negative numbers to be entered, and silently convert them to positive overflowed numbers.
![pj plauger standard c library pj plauger standard c library](https://i.redd.it/mk55qgrzt7d61.png)
I forgot about it, until recently I noticed the same behaviour in VC2008 EE.
![pj plauger standard c library pj plauger standard c library](https://i.pinimg.com/736x/b7/07/12/b707126b47e7e7a2311751f5aab1a899--brisbane-melbourne.jpg)
Hello everybody, Quite long ago (using VS6) I stumbled into some strange behaviour of C++ standard library streams.