Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C99 |
both | z/OS® V1R7 |
#define _ISOC99_SOURCE
#include <inttypes.h>
uintmax_t wcstoumax(const wchar_t * __restrict__ nptr,
wchar_t ** __restrict__ endptr, int base);
The wcstoumax() function converts the wide-character string nptr to an uintmax_t integer type. Valid input values for base are 0 and in the range 2-36. The wcstoumax() function is equivalent to wcstoul() and wcstoull(). The only difference being that the return value is of type uintmax_t. See wcstoull() for more information.
If successful, wcstoumax() returns the converted value, if any.
If unsuccessful, wcstoumax() returns 0 if no conversion could be performed. If the correct value is outside the range of representable values, wcstoumax() returns UINTMAX_MAX. If the value of base is not supported, wcstoumax() returns 0.
If unsuccessful wcstoumax() sets errno to one of the following values:
#define _ISOC99_SOURCE
#include <inttypes.h>
#include <stdio.h>
int main(void)
{
wchar_t *nptr;
wchar_t *endptr;
uintmax_t j;
int base = 10;
nptr = L"10110134932";
printf("nptr = `%ls`\n", nptr);
j = wcstoumax(nptr, &endptr, base);
printf("wcstoumax = %ju\n", j);
printf("Stopped scan at `%ls`\n\n", endptr);
}
Output
nptr = `10110134932`
wcstoumax = 10110134932
Stopped scan at ``