Everything

strtoimax / strtoumax


Converts a number-representing string to an intmax_t type integer.

[Format]

#include <inttypes.h>

intmax_t strtoimax( const char *nptr, char **endptr, long base);

uintmax_t strtoumax(const char *nptr, char **endptr, long base);

[Parameters]

nptr Pointer to a number-representing string to be converted

endptr Pointer to the storage area containing a pointer to the first character that does not represent an integer

base Radix of conversion (0 or 2 to 36)

[Return Values]

Normal: If the string pointed by nptr begins with a character that does not represent an integer: 0

If the string pointed by nptr begins with a character that represents an integer: Converted data as an intmax_t type integer

Abnormal: If the converted data overflows: INTMAX_MAX, INTMAX_MIN, or UINTMAX_MAX

[Remarks]

If the converted result overflows, ERANGE is set in errno.

The strtoimax and strtoumax functions are equivalent to the strtol, strtoll, strtoul, and strtoull functions except that the initial part of the string is respectively converted to intmax_t and uintmax_t integers.