function
<cwctype>

towlower

wint_t towlower ( wint_t c );
Convert uppercase wide character to lowercase
Converts c to its lowercase equivalent if c is an uppercase letter and has a lowercase equivalent. If no such conversion is possible, the value returned is c unchanged.

Notice that what is considered a letter may depend on the locale being used.

If an uppercase character has more than one correspondent lowercase character, this function always returns the same character for the same value of c.

This function is the wide-character equivalent of tolower (<cctype>).

In C++, a locale-specific template version of this function (tolower) exists in header <locale> for all character types.

Parameters

c
Wide character to be converted, casted to a wint_t value, or WEOF.
wint_t is an integral type.

Return Value

The lowercase equivalent to c, if such value exists, or c (unchanged) otherwise.
The value is returned as a wint_t value that can be implicitly casted to wchar_t.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* towlower example */
#include <stdio.h>
#include <wctype.h>
int main ()
{
  int i=0;
  wchar_t str[] = L"Test String.\n";
  wchar_t c;
  while (str[i])
  {
    c = str[i];
    putwchar (towlower(c));
    i++;
  }
  return 0;
}


Output:
test string.

See also