C++ Standard Library C++ STL Library

C++ <cwchar> - wctype_t Type



The wctype_t is an implementation-defined wide character type. It represent distinct codes for all members of the wide character set specified among the supported locales.

In C++, wctype_t is a distinct fundamental type and thus it is not defined in <cwchar> nor in any other header. In C, this is a typedef of an integer type.

Example:

The example below shows the usage of wctype_t type.

#include <iostream>
#include <cwchar>
#include <cwctype>
using namespace std;
 
int main (){
  //initiating a variable str of 
  //wctype_t type
  wchar_t str[256] = L"Hello World!.";

  wcout<<"str contains: "<<str;
  return 0;
}

The output of the above code will be:

str contains: Hello World!.

❮ C++ <cwchar> Library

5