Borland C++ reference

toupper

raw OCR

Translates characters to uppercase.

Defined in header <ctype.h>

Syntax

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

Portability

DOSUNIXWindowsANSI CC++ only
■■■■

Remarks

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

Return value

toupper returns the converted value of ch if it is lowercase; it returns all others unchanged.

Example

#include <string.h>
#include <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] = 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.