GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::iswctype(3) C++ Standard Libary std::iswctype(3)

std::iswctype - std::iswctype


Defined in header <cwctype>
int iswctype( std::wint_t wc, std::wctype_t desc );


Classifies the wide character wc using the current C locale's LC_CTYPE category
identified by desc.


If the value of wc is neither representable as a wchar_t nor equal to the value of
the macro WEOF, the behavior is undefined.


wc - the wide character to classify
desc - the LC_CTYPE category, obtained from a call to std::wctype


Non-zero if the character ch has the property identified by desc in LC_CTYPE facet
of the current C locale, zero otherwise.

// Run this code


#include <clocale>
#include <cwctype>
#include <iostream>
bool classify(wchar_t wc, const std::string& cat)
{
return std::iswctype(wc, std::wctype(cat.c_str()));
}
int main()
{
std::setlocale(LC_ALL, "ja_JP.UTF-8");
std::cout << "The character \u6c34 is...\n";
for(std::string s : {"digit", "alpha", "space", "cntrl", "jkanji"})
std::cout << s << "? " << std::boolalpha << classify(L'\u6c34', s) << '\n';
}


The character 水 is...
digit? false
alpha? true
space? false
cntrl? false
jkanji? true


wctype looks up a character classification category in the current C locale
(function)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.