Facebook Page Twitter Page LinkedIn Page
× C Standard Library

The C <wctype.h> towupper() function is used to convert the given character to uppercase, if it exists. If the uppercase version of the given wide character does not exist, it remains unchanged.

The following lowercase letters abcdefghijklmnopqrstuvwxyz are replaced with respective uppercase letters ABCDEFGHIJKLMNOPQRSTUVWXYZ.


wint_t towupper ( wint_t c );              


ch Specify the wide character to be converted, casted to an wint_t, or WEOF.

Return Value

Returns uppercase version of ch or unchanged ch if no uppercase value is listed in the current C locale.


The below example shows the usage of towupper() function.

#include <stdio.h>
#include <wchar.h>
#include <wctype.h>
int main (){
  wchar_t str[50] = L"HELLO World!";

  //converting str into upper case
  int i = 0;
  while(str[i]) {
    str[i] = towupper(str[i]);

  //displaying the output
  printf("%ls\n", str);  
  return 0;

The output of the above code will be:


❮ C <wctype.h> Library