標準/拡張機能 | C/C++ | 依存項目 |
---|---|---|
C99 |
両方 | z/OS® V1R7 |
#define _ISOC99_SOURCE
#include <inttypes.h>
uintmax_t wcstoumax(const wchar_t * __restrict__ nptr,
wchar_t ** __restrict__ endptr, int base);
wcstoumax() 関数は、ワイド文字ストリング nptr を uintmax_t 整数型に変換します。基数の有効な入力値は、0 および 2 から 36 までの範囲内です。wcstoumax() 関数は、wcstoul() および wcstoull() と同等です。 唯一の違いは、戻り値の型が uintmax_t であることです。詳しくは、wcstoull() を参照してください。
正常に実行された場合、wcstoumax() は、変換された値があれば、それを戻します。
正常に実行されなかった場合、変換が実行できないと、wcstoumax() は 0 を戻します。正しい値が表現可能な値の範囲外にある場合には、wcstoumax() は UINTMAX_MAX を戻します。基数の値がサポートされない場合、wcstoumax() は 0 を戻します。
正常に実行されなかった場合、wcstoumax() は errno を次のいずれかの 値に設定します。
#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);
}
出力:
nptr = `10110134932`
wcstoumax = 10110134932
Stopped scan at ``