Converts the initial portion of the string pointed to by nptr to an unsigned long integer.
#include <stdlib.h> unsigned long int strtoul (const char *nptr, char **endptr, int base);Function Variants This function also has variants named _strtoul32 and _strtoul64 for use with 32-bit and 64-bit pointer sizes, respectively. See Section 1.8 for more information on using pointer-size-specific functions.
If the base is 0, the sequence of characters is interpreted by the same rules used to interpret an integer constant: after the optional sign, a leading 0 indicates octal conversion, a leading 0x or 0X indicates hexadecimal conversion, and any other combination of leading characters indicates decimal conversion.
x | The converted value. |
0 | Indicates that the string starts with an unrecognized character or that the value for base is invalid. If the string starts with an unrecognized character, *endptr is set to nptr. |
ULONG_MAX | Indicates that the converted value would cause an overflow. |
Converts the initial portion of the string pointed to by nptr to an unsigned __int64 integer. strtoull is a synonym for strtouq.
#include <stdlib.h> unsigned __int64 strtouq (const char *nptr, char **endptr, int base); unsigned __int64 strtoull (const char *nptr, char **endptr, int base);Function Variants This function also has variants named _strtouq32/_strtoull32 and _ strtouq64/_strtoull64 for use with 32-bit and 64-bit pointer sizes, respectively. See Section 1.8 for more information on using pointer-size-specific functions.
If the base is 0, the sequence of characters is interpreted by the same rules used to interpret an integer constant: after the optional sign, a leading 0 indicates octal conversion, a leading 0x or 0X indicates hexadecimal conversion, and any other combination of leading characters indicates decimal conversion.
x | The converted value. |
0 | Indicates that the string starts with an unrecognized character or that the value for base is invalid. If the string starts with an unrecognized character, *endptr is set to nptr. |
__UINT64_MAX | Indicates that the converted value would cause an overflow. |