tolower(), _tolower()

convert a character to lowercase


#include <ctype.h>

int tolower( int c );
int _tolower( int c );


The tolower() function converts c to a lowercase letter if c represents an uppercase letter.

The _tolower() function is a version of tolower() to be used only when c is known to be uppercase.


The corresponding lowercase letter when the argument is an uppercase letter; otherwise, the original character is returned.

Note: The result of _tolower() is undefined if c isn't an uppercase letter.


#include <stdio.h>
#include <ctype.h>

char chars[] = {

#define SIZE sizeof( chars ) / sizeof( char )

void main()
    int   i;

    for( i = 0; i < SIZE; i++ ) {
    printf( "%c ", tolower( chars[ i ] ) );
    printf( "\n" );

produces the output:

a 5 $ z


tolower() is ANSI; _tolower() is WATCOM.
Interrupt handler Yes
Signal handler Yes
Thread Yes

See also:

isalnum(), isalpha(), iscntrl(), isdigit(), isgraph(), islower(), isprint(), ispunct(), isspace(), isupper(), isxdigit(), strlwr(), strupr(), toupper()