Syntax | #include <stdlib.h> unsigned long int strtoul(const char *s, char **endptr, int base); | |||||||
Description | The string to be converted may be structured as follows:
Any white-space character may be used for tab (see definition under Depending on the base (see base), the digits 0 to 9 and the letters a (or A) to z (or Z) may be used for digit.
If no conversion is possible at all, *endptr is set to the start address of string s. A third argument, base, defines the base (e.g. decimal, octal or hexadecimal) for the conversion. base may be any integer from 0 to 36. For base 11 to base 36, the letters a (or A) to z (or Z) in the string to be converted are assumed to be digits, with corresponding values from 10 (a/A) to 35 (z/Z). If base is equal to 0, the base will be determined from the structure of string s as shown below:
If the parameter base = 16 is used for calculations, the characters 0X or 0x in string s will be ignored. | |||||||
Return val. | Integer value of type | |||||||
for strings that have a structure as described above and which represent a numeric value. | ||||||||
0 | for strings that do not conform to the syntax described above. | |||||||
| if an overflow occurs; | |||||||
Errors |
| |||||||
|
| The value of base is not supported. | ||||||
|
| The return value causes an overflow. | ||||||
|
| The conversion could not be performed. | ||||||
See also |
|