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.
Code
/* iswlower example */#include <stdio.h>#include <stddef.h>#include <wctype.h>int main (){int i=0;//wide string literal -- all UPPERCASEwchar_t str[] = L"HeLlO WoRlD!";//wide char for inputwchar_t c;//loop to iterate over each char in strwhile (str[i]){c = str[i];if (iswupper(c))printf("%c --> UPPERCASE\n", c);elseprintf("%c --> not uppercase\n", c);i++;}return 0;}
Free Resources
Copyright ©2026 Educative, Inc. All rights reserved