C examples for wctype.h:towctrans
function
<cwctype> <wctype.h>
Convert using transformation
wint_t towctrans(wint_t c, wctrans_t desc);
Applies a the transformation specified by desc to the wide character c.
string passed to wctrans | description | equivalent function |
---|---|---|
"tolower" | to lowercase | towlower |
"toupper" | to uppercase | towupper |
Parameter | Description |
---|---|
c | Wide character to be transformed |
desc | A value returned by a call to wctrans |
The converted character of c, if such value exists, or c (unchanged) otherwise.
#include <stdio.h> #include <wctype.h> int main ()//from www. j av a 2 s. c o m { 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; }