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 macro that does the same conversion as tolower, except that it should be used only when ch is known to be uppercase (A-Z).

To use _tolower, you must include ctype.h.

Return value

_tolower returns the converted value of ch if it is uppercase; otherwise, the result is undefined.

Example

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

int main(void)
{
   int length, i;
   char *string = "THIS IS A STRING.";
   /* We should be checking each character to make sure it  is an uppercase before
      passing it to _tolower! The result of passing it a non-uppercase  is
      undefined. */
   length = strlen(string);
   for (1=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.

Extraction notes

  • heading `tolower` read as `_tolower`