Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
|
Go to the source code of this file.
Functions | |
unsigned long long | strtoull (const char *__restrict nptr, char **__restrict endptr, int base) |
Interprets an unsigned long long value in a byte string pointed to by str. More... | |
unsigned long long strtoull | ( | const char *__restrict | str, |
char **__restrict | str_end, | ||
int | base | ||
) |
Interprets an unsigned long long value in a byte string pointed to by str.
Interprets an unsigned long long value in a byte string pointed to by str. Discards any whitespace characters (as identified by calling
1) (optional) plus or minus sign 2) (optional) prefix (0) indicating octal base (applies only when the base is 8 or 0) 3) (optional) prefix (0x or 0X) indicating hexadecimal base (applies only when the base is16 or 0) 4) a sequence of digits
The set of valid values for base is {0,2,3,...,36}. The set of valid digits for base-2 integers is {0,1}, for base-3 integers is {0,1,2}, and so on. For bases larger than 10, valid digits include alphabetic characters, starting from Aa for base-11 integer, to Zz for base-36 integer. The case of the characters is ignored.
If the value of base is 0, the numeric base is auto-detected: if the prefix is 0, the base is octal, if the prefix is 0x or 0X, the base is hexadecimal, otherwise the base is decimal.
If the minus sign was part of the input sequence, the numeric value calculated from the sequence of digits is negated as if by unary minus in the result type.
If the str is empty or does not have the expected form, no conversion is performed, and (if str_end is not NULL) the value of str is stored in the object pointed to by str_end.
str | pointer to the null-terminated byte string to be interpreted |
str_end | pointer to a pointer to character. |
base | base of the interpreted integer value |
Definition at line 44 of file strtoull.c.
References isspace(), NULL, and ULLONG_MAX.