long int strtol ( const char * str, char ** endptr, int base ) <stdlib.h>
Parameters
str
C string containing the representation of an integral number.
endptr
Reference to an object of type
char*, whose value is set by the function to the next character in
str after the numerical value.
This parameter can also be a null pointer, in which case it is not used.
Return Value
If the
base value is between 2 and 36, the format expected for the integral number is a succession of the valid digits and/or letters needed to represent integers of the specified radix (starting from
'0' and up to
'z'/
'Z' for radix 36). The sequence may optionally be preceded by a plus or minus sign and, if
base is 16, an optional
"0x" or
"0X" prefix.
相关函数