strtouq()

convert string to an unsigned 64-bit integer 

Function


SYNOPSIS

#include <sys/types.h>

#include <stdlib.h>

u_quad_t strtouq(char *nptr, char **endptr, int base);


DESCRIPTION

The strtouq() function converts the string pointed to by nptr to an unsigned 64-bit long-long integer representation. This function recognizes (in order) an optional string of spaces, an optional base indicator (0 for octal, X or x for hexadecimal), and a string of digits. The first unrecognized character ends the string. A pointer to this unrecognized character is stored in the object addressed by endptr, if endptr is not NULL.

If base is non-zero, its value determines the set of recognized digits and also overrides the optional base indicator character. If base is zero, nptr is assumed to be base 10, unless an optional base indicator character is given.


PARAMETERS

nptr 

Points to a character string for strtouq() to convert.

endptr 

Is a result parameter that, if not NULL, is loaded with the address of the first character that strtouq() does not attempt to convert.

base 

Is the base of the string, a value between 0 and 36.


RETURN VALUES

The strtouq() function returns the converted value, if there is any. If no conversion was performed, strtouq() returns a value of zero. If the converted value overflows, strtouq() returns UQUAD_MAX and sets errno to ERANGE.


CONFORMANCE

4.4BSD.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
strtoq(), strtoul()


PTC MKS Toolkit 10.0 Documentation Build 6.