[Bug libstdc++/13112] istream doesn't read hexadecimal

paolo at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Nov 18 23:21:00 GMT 2003


------- Additional Comments From paolo at gcc dot gnu dot org  2003-11-18 23:21 -------
Either you use a manipulator:

  #include <iomanip>
  ...

  std::istringstream("0x01") >> std::hex >> val;

or, if you want the hexadecimal base automatically recognized, clear the
flags in the basefield mask (by default, is dec):

  std::istringstream iss("0x01");
  iss.unsetf(std::ios::basefield);
  iss >> val;

or many other possibilities...
In short, definitely not a bug ;)

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13112



More information about the Gcc-bugs mailing list