Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / C

islower — C23 character classification function

`islower(c)` from `<ctype.h>` returns a nonzero value when `c` is a lowercase letter in the current locale. In the `C` locale it includes at least the characters `a` through `z`; another locale may classify additional single-byte letters.

Version: C23

Syntax

int islower(int c);

islower(c) from <ctype.h> returns a nonzero value when c is a lowercase letter in the current locale. In the C locale it includes at least the characters a through z; another locale may classify additional single-byte letters.

The example tests a, z, A, and 7 in the initial C locale and normalizes with != 0. Output 1 1 0 0 demonstrates both ends of the basic lowercase range and rejects an uppercase letter and a digit.

The argument must be EOF or representable as unsigned char; a negative plain char has undefined behavior. For a byte use islower((unsigned char)ch), preserving EOF separately. The result follows LC_CTYPE and is not a Unicode lowercase test; use toupper for conversion rather than arithmetic on the character code.

Examples

#include <ctype.h>
#include <stdio.h>
int main(void){int values[]={'a','z','A','7'};printf("%d %d %d %d\n",islower(values[0])!=0,islower(values[1])!=0,islower(values[2])!=0,islower(values[3])!=0);return 0;}

Result

1 1 0 0

The example tests `a`, `z`, `A`, and `7` in the initial `C` locale and normalizes with `!= 0`. Output `1 1 0 0` demonstrates both ends of the basic lowercase range and rejects an uppercase letter and a digit.

Sources