strtoull.c

The libc implementation

Author

Martin ‘Solar’ Baute

License

Public Domain

Functions

strtoull

unsigned long long int strtoull(const char *s,
char **endptr,
int base)

Converts a string in s to an unsigned long long.

A nonzero base can be supplied to force a specific radix.

endptr can be supplied in order to get a pointer to the remainder of the string.

Returns the value in the string if present, clamped to the maximum on overflow

Returns 0 if the string isn’t a number

Todo’s

test “odd” overflow, i. e. base is not power of two

test “odd” overflow, i. e. base is not power of two

unsigned long long int strtoull(const char *s,
char **endptr,
int base)
Converts a string in s to an unsigned long long.