Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      iswctype

      From cppreference.com
      <c‎ |string‎ |wide
       
       
       
      Null-terminated wide strings
       
      Defined in header<wctype.h>
      int iswctype( wint_t wc, wctype_t desc);
      (since C95)

      Classifies the wide characterwc using the current C locale'sLC_CTYPE category identified bydesc.

      Contents

      [edit]Parameters

      wc - the wide character to classify
      desc - theLC_CTYPE category, obtained from a call towctype

      [edit]Return value

      Non-zero if the characterwc has the property identified bydesc inLC_CTYPE facet of the current C locale, zero otherwise.

      [edit]Example

      Run this code
      #include <locale.h>#include <stdio.h>#include <wchar.h>#include <wctype.h> constchar* classify(wchar_t wc,constchar* cat){return iswctype(wc,wctype(cat))?"true":"false";} int main(void){setlocale(LC_ALL,"ja_JP.UTF-8");puts("The character\u6c34 is...");constchar* cats[]={"digit","alpha","space","cntrl","jkanji"};for(int n=0; n<5;++n)printf("%s?\t%s\n", cats[n], classify(L'\u6c34', cats[n]));}

      Output:

      The character 水 is...digit?  falsealpha?  truespace?  falsecntrl?  falsejkanji? true

      [edit]References

      • C23 standard (ISO/IEC 9899:2024):
      • 7.30.2.2.1 The iswctype function (p: TBD)
      • C17 standard (ISO/IEC 9899:2018):
      • 7.30.2.2.1 The iswctype function (p: TBD)
      • C11 standard (ISO/IEC 9899:2011):
      • 7.30.2.2.1 The iswctype function (p: 451-452)
      • C99 standard (ISO/IEC 9899:1999):
      • 7.25.2.2.1 The iswctype function (p: 397-398)

      [edit]See also

      (C95)
      looks up a character classification category in the current C locale
      (function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=c/string/wide/iswctype&oldid=153725"

      [8]ページ先頭

      ©2009-2025 Movatter.jp