wcstoul(), wcstoull(), wcstoumax(), wcstouq(), wcstoul_l(), wcstoull_l(), wcstoumax_l() -- convert wide character string to various unsigned integral types

wcstoul()

convert wide character string to various unsigned integral types 

wcstoul(), wcstoull(), wcstoumax(), wcstouq(), wcstoul_l(), wcstoull_l(), wcstoumax_l()

convert wide character string to various unsigned integral types 

Function


SYNOPSIS

#include <wchar.h>

unsigned long wcstoul(const wchar_t *nptr, wchar_t **endptr, int base);

unsigned long long wcstoull(const wchar_t *nptr, wchar_t **endptr, int base);

uquad_t wcstouq(const wchar_t *nptr, wchar_t **endptr, int base);

unsigned long wcstoul_l(const wchar_t *nptr, wchar_t **endptr, int base, locale_t locale);

unsigned long long wcstoull_l(const wchar_t *nptr, wchar_t **endptr, int base, locale_t locale);

#include <inttypes.h>

uintmax_t wcstoumax(const wchar_t *nptr, wchar_t **endptr, int base);

uintmax_t wcstoumax_l(const wchar_t *nptr, wchar_t **endptr, int base, locale_t locale);


DESCRIPTION

The wcstoul() class of functions convert the input string nptr into unsigned long, unsigned long long, uquad_t or uintmax_t. The scanning stops at the first character that is not recognized as part of the number. This character can be the terminating NULL. This conversion occurs if a string of the expected form is passed in. The expected form consists of an initial, possibly empty, sequence of white-space characters, a sequence of characters interpreted as an integer, and a final sequence of wide characters that are not recognized as part followed by a terminating NULL character.

If the value of base is 0, then the expected form of the sequence to be converted must be that of a decimal constant, octal constant or a hexadecimal constant. Each of the may be preceded by a + or - sign. A decimal constant must begin with a non-zero digit and be followed by a sequence of decimal digits. An octal constant must begin with a 0 prefix an optionally followed by a sequence of digits ranging from 0 to 7. A hexadecimal constant must be preceded by a 0x or 0X and followed by a sequence of decimal digits and the letters a(A) to f(F) with the values of 10 to 15 respectively.

If the value of base is between 2 and 36, then the expected form of the sequence to be converted must be a sequence of digits and letters representing an integer with a radix defined by base. The letters a(A) through z(Z) represent the values from 10 to 35 respectively. Only letters whose value are less than base are permitted. If the value of base is 16, then the sequence to be converted may optionally be preceded by 0x or 0X.

A pointer to the final sequence of wide characters is stored in the object pointed to by endptr, provided that endptr is not a NULL pointer.


PARAMETERS

nptr 

Is the null-terminated string to convert.

endptr 

Points to a character that stops the scan.

base 

Is the number base to use.

locale 

Is a locale_t perhaps returned by newlocale() or LC_GLOBAL_LOCALE or 0 for the current thread locale set with uselocale().


RETURN VALUES

Upon successful completion the wcstoul() class of functions return the converted value, if any. If no conversion could be performed 0 is returned and errno is set appropriately. If the converted value is outside the range of representable values, ULONG_MAX, ULONGLONG_MAX, UQUAD_MAX or UINTMAX_MAX is returned and errno is set. If the function fails, errno is set to one of the following values:

ERANGE 

The value is outside the range of representable values.

EINVAL 

The conversion could not be performed or the value of base is not supported.


CONFORMANCE

wcstoul(), wcstoull() and wcstoumax() conform to ANSI/ISO 9899-1990.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

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


SEE ALSO

Functions:
newlocale(), setlocale(), wcstod(), wcstod_l(), wcstof(), wcstof_l(), wcstoimax(), wcstoimax_l(), wcstol(), wcstol_l(), wcstold(), wcstold_l(), wcstoll(), wcstoll_l(), wcstoq()


PTC MKS Toolkit 10.3 Documentation Build 39.