Borland C++ reference

_toupper

raw OCR

Translates characters to uppercase.

Defined in header <ctype.h>

Syntax

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

_toupper  is a macro that does the same conversion as toupper, except that
it should be used only when  ch is known to be lowercase {a to z).

To use _toupper, you  must include ctype.h.

Portability

DOSUNIXWindowsANSI CC++ only
■■■

Return value

_toupper returns the converted value of ch if it is lowercase; 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 lowercase before
      passing it to _toupper. The result passing  a non-lowercase is undefined. */
   length = strlen(string);
   for (1=0;   i < length; i++)
      string[i] = _toupper(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.