C examples for ctype.h:isupper
function
<cctype> <ctype.h>
int isupper ( int c );
Check if character is uppercase letter. In the default locale, an uppercase letter is any of: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z.
Parameter | Description |
---|---|
c | Character to be checked, casted to an int, or EOF. |
A non zero value (i.e., true) if indeed c is an uppercase alphabetic letter. Zero (i.e., false) otherwise.
#include <stdio.h> #include <ctype.h> int main ()//from w w w.j av a 2s .c om { int i=0; char str[]="this IS a test. Test String.\n"; char c; while (str[i]) { c=str[i]; if (isupper(c)) c=tolower(c); putchar (c); i++; } return 0; }