istringstream not honoring base?
问题 I'm trying to remediate some Coverity findings on tainted values due to the use of atoi and atof . I switched to an istringstream , but its not producing expected results for bases other than 10. If I switch to base 16, enter 0xa and avoid the iss.ignore(2); , then the result is 0: $ ./tt.exe 0xa X: 0 If I switch to base 16, enter 0xa and utilize the iss.ignore(2); , then the result is an exception: $ ./tt.exe 0xa '0xa' is not a value I visited CPP Reference on istringstream as recommended by