Mega Code Archive

 
Categories / C Tutorial / Wide Character String
 

Change case

The functions wctrans() and towctrans() are also defined in wctrans_t wctrans(const char *mapping); wint_t towctrans(wint_t ch, wctrans_t mapping_ob); tolower toupper The following sequence demonstrates wctrans() and towctrans(): #include <wctype.h> #include <stdio.h> int main(void){   wctrans_t x;   x = wctrans("tolower");   wchar_t ch = towctrans(L'W', x);   printf("%c", (char) ch); }