[Previous]
[Contents]
[Next]

tolower(), _tolower()

convert a character to lowercase

Synopsis:

#include <ctype.h>

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

Description:

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.

Returns:

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.

Examples:

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

char chars[] = {
    'A',
    '5',
    '$',
    'Z'
};

#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

Classification:

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

See also:

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


[Previous]
[Contents]
[Next]