function
<cwctype>
iswupper
Check if wide character is uppercase letter
Checks whether c is an uppercase letter.
Notice that what is considered a letter may depend on the locale being used.
This function is the wide-character equivalent of isupper (<cctype>): If c translates with wctob to a character for which isupper is true, it is always considered an uppercase letter character by this function too.
In C++, a locale-specific template version of this function (isupper) exists in header <locale> for all character types.
Parameters
- c
- Wide character to be checked, casted to a wint_t, or WEOF.
wint_t is an integral type.
Return Value
A value different from zero (i.e., true) if indeed c is an uppercase letter. Zero (i.e., false) otherwise.
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
/* iswlower 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];
if (iswupper(c)) c=towlower(c);
putwchar (c);
i++;
}
return 0;
}
|
Output:
See also
- isupper
- Check if character is uppercase letter (function
)
- iswlower
- Check if wide character is lowercase letter (function
)
- iswalpha
- Check if wide character is alphabetic (function
)
- towupper
- Convert lowercase wide character to uppercase (function
)
- towlower
- Convert uppercase wide character to lowercase (function
)
- isupper (locale)
- Check if character is an uppercase letter using locale (function template
)