Standard C++ Library Reference ISO/IEC (VERSION3)
Here, a point is the decimal-point character for the current locale. (It is the dot (.) in the "C"
locale.) If the string s matches this pattern, its equivalent value is the decimal integer
represented by any digits to the left of the point, plus the decimal fraction represented by any
digits to the right of the point, times 10 raised to the signed decimal integer power that
follows an optional e or E. A leading minus sign negates the value.
In locales other than the "C" locale, strtod can define additional patterns as well.
If the string s does not match a valid pattern, the value stored in *endptr is s, and x is zero.
If a range error occurs, strtod behaves exactly as the functions declared in <math.h>.
strtol
long strtol(const char *s, char **endptr,
int base);
The function converts the initial characters of the string s to an equivalent value x of type long.
If endptr is not a null pointer, it stores a pointer to the unconverted remainder of the string in
*endptr. The function then returns x.
The initial characters of the string s must consist of zero or more characters for which
isspace returns nonzero, followed by the longest sequence of one or more characters that
match the pattern for strtol shown in the diagram.
The function accepts the sequences 0x or 0X only when base equals zero or 16. The letters
a-z or A-Z represent digits in the range [10, 36). If base is in the range [2, 36], the function
accepts only digits with values less than base. If base == 0, then a leading 0x or 0X (after
any sign) indicates a hexadecimal (base 16) integer, a leading 0 indicates an octal (base 8)
integer, and any other valid pattern indicates a decimal (base 10) integer.
If the string s matches this pattern, its equivalent value is the signed integer of the appropriate
base represented by the digits that match the pattern. (A leading minus sign negates the value.)