Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      Standard library header <wchar.h> (C95)

      From cppreference.com
      <c‎ |header
       
       
       

      This header is part ofnull-terminated wide strings library.

      Contents

      [edit]Functions

      Conversions to numeric formats
      (C95)(C99)
      converts a wide string to an integer value
      (function)[edit]
      (C95)(C99)
      converts a wide string to an unsigned integer value
      (function)[edit]
      (C99)(C95)(C99)
      converts a wide string to a floating-point value
      (function)[edit]
      String manipulation
      (C95)(C11)
      copies one wide string to another
      (function)[edit]
      copies a certain amount of wide characters from one string to another
      (function)[edit]
      (C95)(C11)
      appends a copy of one wide string to another
      (function)[edit]
      appends a certain amount of wide characters from one wide string to another
      (function)[edit]
      (C95)
      transform a wide string so thatwcscmp would produce the same result aswcscoll
      (function)[edit]
      String examination
      (C95)(C11)
      returns the length of a wide string
      (function)[edit]
      (C95)
      compares two wide strings
      (function)[edit]
      (C95)
      compares a certain amount of characters from two wide strings
      (function)[edit]
      (C95)
      compares two wide strings in accordance to the current locale
      (function)[edit]
      (C95)
      finds the first occurrence of a wide character in a wide string
      (function)[edit]
      (C95)
      finds the last occurrence of a wide character in a wide string
      (function)[edit]
      (C95)
      returns the length of the maximum initial segment that consists
      of only the wide characters found in another wide string
      (function)[edit]
      (C95)
      returns the length of the maximum initial segment that consists
      of only the wide charsnot found in another wide string
      (function)[edit]
      (C95)
      finds the first location of any wide character in one wide string, in another wide string
      (function)[edit]
      (C95)
      finds the first occurrence of a wide string within another wide string
      (function)[edit]
      (C95)(C11)
      finds the next token in a wide string
      (function)[edit]
      Wide character array manipulation
      copies a certain amount of wide characters between two non-overlapping arrays
      (function)[edit]
      copies a certain amount of wide characters between two, possibly overlapping, arrays
      (function)[edit]
      (C95)
      compares a certain amount of wide characters from two arrays
      (function)[edit]
      (C95)
      finds the first occurrence of a wide character in a wide character array
      (function)[edit]
      (C95)
      copies the given wide character to every position in a wide character array
      (function)[edit]

      [edit]Types

      wchar_t
      integer type that can hold any valid wide character
      (typedef)
      wint_t
      (C95)
      integer type that can hold any valid wide character and at least one more value
      (typedef)

      [edit]Macros

      WEOF
      (C95)
      a non-character value of typewint_t used to indicate errors
      (macro constant)
      WCHAR_MIN
      (C95)
      the smallest valid value ofwchar_t
      (macro constant)
      WCHAR_MAX
      (C95)
      the largest valid value ofwchar_t
      (macro constant)

      [edit]Synopsis

      #define __STDC_VERSION_WCHAR_H__ 202311L typedef/* see description */wchar_t;typedef/* see description */size_t;typedef/* see description */mbstate_t;typedef/* see description */ wint_t; structtm{/* see description */}; #define MB_UTF16    /* see description */#define MB_UTF32    /* see description */#define MB_UTF8     /* see description */#define NULL        /* see description */#define WCHAR_MAX   /* see description */#define WCHAR_MIN   /* see description */#define WCHAR_UTF16 /* see description */#define WCHAR_UTF32 /* see description */#define WCHAR_UTF8  /* see description */#define WCHAR_WIDTH /* see description */#define WEOF        /* see description */ intfwprintf(FILE*restrict stream,constwchar_t*restrict format, ...);intfwscanf(FILE*restrict stream,constwchar_t*restrict format, ...);intswprintf(wchar_t*restrict s,size_t n,constwchar_t*restrict format, ...);intswscanf(constwchar_t*restrict s,constwchar_t*restrict format, ...);intvfwprintf(FILE*restrict stream,constwchar_t*restrict format, va_list arg);intvfwscanf(FILE*restrict stream,constwchar_t*restrict format, va_list arg);intvswprintf(wchar_t*restrict s,size_t n,constwchar_t*restrict format,              va_list arg);intvswscanf(constwchar_t*restrict s,constwchar_t*restrict format, va_list arg);intvwprintf(constwchar_t*restrict format, va_list arg);intvwscanf(constwchar_t*restrict format, va_list arg);intwprintf(constwchar_t*restrict format, ...);intwscanf(constwchar_t*restrict format, ...);wint_tfgetwc(FILE* stream);wchar_t* fgetws(wchar_t*restrict s,int n,FILE*restrict stream);wint_tfputwc(wchar_t c,FILE* stream);intfputws(constwchar_t*restrict s,FILE*restrict stream);int fwide(FILE* stream,int mode);wint_t getwc(FILE* stream);wint_tgetwchar(void);wint_t putwc(wchar_t c,FILE* stream);wint_tputwchar(wchar_t c);wint_tungetwc(wint_t c,FILE* stream);doublewcstod(constwchar_t*restrict nptr,wchar_t**restrict endptr);floatwcstof(constwchar_t*restrict nptr,wchar_t**restrict endptr);longdoublewcstold(constwchar_t*restrict nptr,wchar_t**restrict endptr);longintwcstol(constwchar_t*restrict nptr,wchar_t**restrict endptr,int base);longlongintwcstoll(constwchar_t*restrict nptr,wchar_t**restrict endptr,int base);unsignedlongintwcstoul(constwchar_t*restrict nptr,wchar_t**restrict endptr,int base);unsignedlonglongintwcstoull(constwchar_t*restrict nptr,wchar_t**restrict endptr,int base);wchar_t*wcscpy(wchar_t*restrict s1,constwchar_t*restrict s2);wchar_t*wcsncpy(wchar_t*restrict s1,constwchar_t*restrict s2,size_t n);wchar_t*wmemcpy(wchar_t*restrict s1,constwchar_t*restrict s2,size_t n);wchar_t*wmemmove(wchar_t* s1,constwchar_t* s2,size_t n);wchar_t*wcscat(wchar_t*restrict s1,constwchar_t*restrict s2);wchar_t*wcsncat(wchar_t*restrict s1,constwchar_t*restrict s2,size_t n);intwcscmp(constwchar_t* s1,constwchar_t* s2);intwcscoll(constwchar_t* s1,constwchar_t* s2);intwcsncmp(constwchar_t* s1,constwchar_t* s2,size_t n);size_twcsxfrm(wchar_t*restrict s1,constwchar_t*restrict s2,size_t n);intwmemcmp(constwchar_t* s1,constwchar_t* s2,size_t n);/*QWchar_t*/*wcschr(/*QWchar_t*/* s,wchar_t c);size_twcscspn(constwchar_t* s1,constwchar_t* s2);/*QWchar_t*/*wcspbrk(/*QWchar_t*/* s1,constwchar_t* s2);/*QWchar_t*/*wcsrchr(/*QWchar_t*/* s,wchar_t c);size_twcsspn(constwchar_t* s1,constwchar_t* s2);/*QWchar_t*/*wcsstr(/*QWchar_t*/* s1,constwchar_t* s2);wchar_t*wcstok(wchar_t*restrict s1,constwchar_t*restrict s2,wchar_t**restrict ptr);/*QWchar_t*/*wmemchr(/*QWchar_t*/* s,wchar_t c,size_t n);size_twcslen(constwchar_t* s);size_t wcsnlen(constwchar_t* s,size_t n);wchar_t*wmemset(wchar_t* s,wchar_t c,size_t n);size_twcsftime(wchar_t*restrict s,size_t maxsize,constwchar_t*restrict format,conststructtm*restrict timeptr);wint_tbtowc(int c);intwctob(wint_t c);intmbsinit(constmbstate_t* ps);size_tmbrlen(constchar*restrict s,size_t n,mbstate_t*restrict ps);size_tmbrtowc(wchar_t*restrict pwc,constchar*restrict s,size_t n,mbstate_t*restrict ps);size_twcrtomb(char*restrict s,wchar_t wc,mbstate_t*restrict ps);size_tmbsrtowcs(wchar_t*restrict dst,constchar**restrict src,size_t len,mbstate_t*restrict ps);size_twcsrtombs(char*restrict dst,constwchar_t**restrict src,size_t len,mbstate_t*restrict ps);

      Only if the implementation defines__STDC_IEC_60559_DFP__:

      _Decimal32 wcstod32(constwchar_t*restrict nptr,wchar_t**restrict endptr);_Decimal64 wcstod64(constwchar_t*restrict nptr,wchar_t**restrict endptr);_Decimal128 wcstod128(constwchar_t*restrict nptr,wchar_t**restrict endptr);

      Only if the implementation defines__STDC_IEC_60559_TYPES__ and additionally the user codedefines__STDC_WANT_IEC_60559_TYPES_EXT__ before any inclusion of<wchar.h>:

      #ifdef __STDC_WANT_IEC_60559_TYPES_EXT__/*_FloatN*//*wcstofN*/(constwchar_t*restrict nptr,wchar_t**restrict endptr);/*_FloatNx*//*wcstofNx*/(constwchar_t*restrict nptr,wchar_t**restrict endptr);/*_DecimalN*//*wcstodN*/(constwchar_t*restrict nptr,wchar_t**restrict endptr);/*_DecimalNx*//*wcstodNx*/(constwchar_t*restrict nptr,wchar_t**restrict endptr);void/*wcstoencfN*/(unsignedchar encptr[restrictstatic N/8],constwchar_t*restrict nptr,wchar_t**restrict endptr);void/*wcstoencdecdN*/(unsignedchar encptr[restrictstatic N/8],constwchar_t*restrict nptr,wchar_t**restrict endptr);void/*wcstoencbindN*/(unsignedchar encptr[restrictstatic N/8],constwchar_t*restrict nptr,wchar_t**restrict endptr);#endif

      Only if the implementation defines__STDC_LIB_EXT1__ and additionally the user code defines__STDC_WANT_LIB_EXT1__ before any inclusion of<wchar.h>:

      #ifdef __STDC_WANT_LIB_EXT1__typedef/* see description */ errno_t;typedef/* see description */ rsize_t; int fwprintf_s(FILE*restrict stream,constwchar_t*restrict format, ...);int fwscanf_s(FILE*restrict stream,constwchar_t*restrict format, ...);int snwprintf_s(wchar_t*restrict s, rsize_t n,constwchar_t*restrict format, ...);int swprintf_s(wchar_t*restrict s, rsize_t n,constwchar_t*restrict format, ...);int swscanf_s(constwchar_t*restrict s,constwchar_t*restrict format, ...);int vfwprintf_s(FILE*restrict stream,constwchar_t*restrict format, va_list arg);int vfwscanf_s(FILE*restrict stream,constwchar_t*restrict format, va_list arg);int vsnwprintf_s(wchar_t*restrict s, rsize_t n,constwchar_t*restrict format,                 va_list arg);int vswprintf_s(wchar_t*restrict s, rsize_t n,constwchar_t*restrict format,                va_list arg);int vswscanf_s(constwchar_t*restrict s,constwchar_t*restrict format, va_list arg);int vwprintf_s(constwchar_t*restrict format, va_list arg);int vwscanf_s(constwchar_t*restrict format, va_list arg);int wprintf_s(constwchar_t*restrict format, ...);int wscanf_s(constwchar_t*restrict format, ...);errno_t wcscpy_s(wchar_t*restrict s1, rsize_t s1max,constwchar_t*restrict s2);errno_t wcsncpy_s(wchar_t*restrict s1, rsize_t s1max,constwchar_t*restrict s2,                  rsize_t n);errno_t wmemcpy_s(wchar_t*restrict s1, rsize_t s1max,constwchar_t*restrict s2,                  rsize_t n);errno_t wmemmove_s(wchar_t* s1, rsize_t s1max,constwchar_t* s2, rsize_t n);errno_t wcscat_s(wchar_t*restrict s1, rsize_t s1max,constwchar_t*restrict s2);errno_t wcsncat_s(wchar_t*restrict s1, rsize_t s1max,constwchar_t*restrict s2,                  rsize_t n);wchar_t* wcstok_s(wchar_t*restrict s1, rsize_t*restrict s1max,constwchar_t*restrict s2,wchar_t**restrict ptr);size_t wcsnlen_s(constwchar_t* s,size_t maxsize);errno_t wcrtomb_s(size_t*restrict retval,char*restrict s, rsize_t smax,wchar_t wc,mbstate_t*restrict ps);errno_t mbsrtowcs_s(size_t*restrict retval,wchar_t*restrict dst, rsize_t dstmax,constchar**restrict src, rsize_t len,mbstate_t*restrict ps);errno_t wcsrtombs_s(size_t*restrict retval,char*restrict dst, rsize_t dstmax,constwchar_t**restrict src, rsize_t len,mbstate_t*restrict ps);#endif
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=c/header/wchar&oldid=180747"

      [8]ページ先頭

      ©2009-2025 Movatter.jp