isupper - C ctype.h

C examples for ctype.h:isupper

Type

function

from

<cctype> 
<ctype.h>

Prototype

int isupper ( int c );

Description

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.

Parameters

Parameter Description
cCharacter to be checked, casted to an int, or EOF.

Return Value

A non zero value (i.e., true) if indeed c is an uppercase alphabetic letter. Zero (i.e., false) otherwise.

Demo Code

#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;
}

Related Tutorials