wctrans - C wctype.h

C examples for wctype.h:wctrans

Type

function

From


<cwctype>
<wctype.h>

Description

Return character transformation

string passed as property description equivalent function
"tolower" to lowercase towlower
"toupper" to uppercase towupper

Prototype

wctrans_t wctrans (const char* property);

Parameters

Parameter Description
property A string identifying a character transformation.

Return Value

A value of type wctrans_t identifying a character category.

Demo Code


#include <stdio.h>
#include <wctype.h>
int main ()//from   www.  j av  a2 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;
}

Related Tutorials