C Standard Libraries C++

wctype()

Declaration

wctype_t wctype(const char* kcpCategory);

Description

This function takes the category that is specified by the string argument "kcpCategory" that is passed in, and returns the equivalent category type as specified by a wctype_t value. Possible string arguments include the following: "alnum", "alpha", "blank", "cntrl", "digit", "graph", "lower", "print", "space", "upper", and "xdigit".

Example

#include <iostream>
#include <cwctype>

int main() {
    using namespace std;

    wcout << "Lowercase: " << L'x' << endl;
    wcout << "Uppercase: " <<
        (wchar_t)towctrans(L'x', wctype("upper")) << endl;

    return 0;
}

Output

wctype() Output
 

© 2007–2024 XoaX.net LLC. All rights reserved.