Change case : Change Case « Wide Character String « C Tutorial






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);
  1. tolower
  2. 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);

}








16.8.Change Case
16.8.1.Change wide character string to uppercase
16.8.2.Change case