What is iswupper() in C?

iswupper() is a built-in function defined in the <wctype> header in C.

The function checks whether or not the given wide character is an uppercase letter. This check is specific to the current locale being used.

Syntax

The function prototype:

int iswupper(std::wint_t ch);

iswupper() returns non-zero if the input wide character is in uppercase. Otherwise, the function returns zero.

Wide characters

A wide character has a size greater than the traditional 8-bit character.

A wide string literal is prefixed by L.

The iswupper() function

Code

/* iswlower example */
#include <stdio.h>
#include <stddef.h>
#include <wctype.h>
int main ()
{
int i=0;
//wide string literal -- all UPPERCASE
wchar_t str[] = L"HeLlO WoRlD!";
//wide char for input
wchar_t c;
//loop to iterate over each char in str
while (str[i])
{
c = str[i];
if (iswupper(c))
printf("%c --> UPPERCASE\n", c);
else
printf("%c --> not uppercase\n", c);
i++;
}
return 0;
}
New on Educative
Learn any Language for FREE all September 🎉
For the entire month of September, get unlimited access to our entire catalog of beginner coding resources.
🎁 G i v e a w a y
30 Days of Code
Complete Educative’s daily coding challenge every day in September, and win exciting Prizes.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved