在C ++标准模板libraray(STL)中,iswctype()函数用于检查给定的宽字符是否具有desc指定的属性。
Iswctype()是一个内置函数,其头文件为“ ctype.h”。
int iswctype(wint_t c, wctype_t desc); iswctype () / Checks whether whether c has the property specified by desc. /
int iswctype(wint_t c, wctype_t desc);
C-检查转换为整数类型wint_t的宽字符
Desc-它是调用wctype返回的值,这是一个标量类型,用作wctype(宽字符类型)的返回类型。
如果c确实具有由desc标识的属性,则该值不同于零(即true)。否则为零(即false)。
#include <stdio.h>
#include <wctype.h>
int main (){
   int i=0;
   wchar_t str[] = L"Test String.\n";
   wchar_t c;
   wctype_t check = wctype("lower");
   wctrans_t trans = wctrans("toupper");
   while (str[i]){
      c = str[i];
      if (iswctype(c,check)) c = towctrans(c,trans);
         putwchar (c);
         i++;
   }
   return 0;
}输出结果
如果我们运行上面的代码,它将生成以下输出-
TEST STRING.