Borland C++ reference

tolower

raw OCR

Translates characters to lowercase.

Defined in header <ctype.h>

Syntax

#include <ctype.h>
int tolower(int ch);

Portability

DOSUNIXWindowsANSI CC++ only
■■■■

Remarks

tolower is a function that converts an integer ch (in the range EOF to 255) to its lowercase value {a to z; if it was uppercase, A to Z). All others are left unchanged.

Return value

tolower returns the converted value of ch if it is uppercase; it returns all, others unchanged.

Example

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

int main(void)
{
   int length, i;
char *string =  "THIS IS A STRING";
length = strlen(string) ;
for  (i = 0; i < length; i++)
   string[i] = tolower (string[i]);
printf {"%s\n",string);
return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.