Header file:
wctype.h
Synopsis:
int iswupper(wint_t wc)
Description:
Return non-zero if the given input is a upper case letter. Otherwise it returns 0.
Sample program for iswupper in C:
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>
int main() {
wint_t wide_char;
char input;
printf("Enter your input:");
input = getchar();
/* mbtowc -converts single byte to wide character format */
wide_char = btowc(input);
if (iswupper(wide_char))
printf("It is a upper case character\n");
else
printf("It is not a upper case character\n");
printf("Return value: %d\n", iswupper(wide_char));
return 0;
}
#include <wchar.h>
#include <wctype.h>
int main() {
wint_t wide_char;
char input;
printf("Enter your input:");
input = getchar();
/* mbtowc -converts single byte to wide character format */
wide_char = btowc(input);
if (iswupper(wide_char))
printf("It is a upper case character\n");
else
printf("It is not a upper case character\n");
printf("Return value: %d\n", iswupper(wide_char));
return 0;
}
Output:
Enter your input:A
It is a upper case character
Return value: 256
It is a upper case character
Return value: 256
No comments:
Post a Comment