long int strtol (const char* str, char** endptr, int base);
long int
value. If endptr is not a null pointer, the function also sets the value of endptr to point to the first character after the number.+
or -
)"0"
or "0x"/"0X"
respectively)'0'
and up to 'z'
/'Z'
for radix 36). The sequence may optionally be preceded by a sign (either +
or -
) and, if base is 16, an optional "0x"
or "0X"
prefix."C"
locale, additional subject sequence forms may be accepted.char*
, whose value is set by the function to the next character in str after the numerical value.0
, the base used is determined by the format in the sequence (see above).long int
value.0L
).long int
, the function returns LONG_MAX or LONG_MIN (defined in <climits>), and errno is set to ERANGE.
|
|
The decimal equivalents are: 2001, 6340800, -3624224 and 7340031 |