This documentation is copyright © 1998-2001 Sandro Sigala <sandro@sigala.it>.
All rights reserved.
Released under the GNU General Public License.
islower
Prototype
#include <ctype.h>
int islower(int c);
Description
In the ``C'' locale, returns a true value for the characters defined
as lowercase letters. In other implementation-defined set
of characters returns true for the characters for which none of
iscntrl
, isdigit
, ispunct
, or isspace
is true.
Example
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
/*
* Count the lowercase, uppercase, and other characters read from
* standard input.
*/
int main(void)
{
int lower = 0, upper = 0, other = 0;
int c;
while ((c = getchar()) != EOF)
if (islower(c))
++lower;
else if (isupper(c))
++upper;
else
++other;
printf("Lower case: %d, upper case: %d, other: %d\n",
lower, upper, other);
return EXIT_SUCCESS;
}
References
ISO C 9899:1990 7.3.1.6