Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chrtbl(8)

environ(4)

conv(3)

isxdigit(3)

islower(3)

isupper(3)

isalpha(3)

isalnum(3)

isspace(3)

iscntrl(3)

ispunct(3)

isprint(3)

isgraph(3)

isascii(3)

toupper(3)

toascci(3)

_tolower(3)

setchrclass(3)

stdio(3)



  toupper(3)                          CLIX                          toupper(3)



  NAME

    toupper, _toupper - Returns an uppercase letter

  LIBRARY

    Standard C Library (libc.a)

  SYNOPSIS

    #include <ctype.h>

    int toupper(
      int c );

    int _toupper(
      int c );

  PARAMETERS

    c   An integer representing a character

  DESCRIPTION

    The toupper() macro and the _toupper() function return the corresponding
    uppercase character, if one exists, of a character for which isupper() is
    true.  Otherwise the character is returned unchanged.

    The conversion macro toupper() works the same as the conversion function
    _toupper(), except that the macros do not range check and are therefore
    faster.  Both the conversion macro and function do table lookup.

  EXAMPLES

    To convert each character in a string from lower to uppercase:

    #include <ctype.h>
         .
         .
         .
    int   len,i;
    char  name[10];

    /* copy a string into the variable `name' */
    strcpy (name, "mary")

    /* find out the length of the string */
    len = strlen(name);

    /* convert each character of the string to uppercase */
    for (i = 0; i < len; i++)



  2/94 - Intergraph Corporation                                              1






  toupper(3)                          CLIX                          toupper(3)



         name[i] = (char) toupper((int) (name[i]));
    printf("uppercase name is %s \n", name);
         .
         .
         .


  CAUTIONS

    If the argument to any character handling macro is not in the domain of
    the function, the result is undefined.

  RETURN VALUES

    The toupper() macro returns The uppercase version of the input character
    if the input is a uppercase character; otherwise the character is returned
    unchanged.

    The _toupper() function returns the uppercase version of the input
    character if the input is an uppercase character; otherwise the return
    value is undefined.

  RELATED INFORMATION

    Commands:  chrtbl(8)

    Files: environ(4)

    Functions:  conv(3), isxdigit(3), islower(3), isupper(3), isalpha(3),
    isalnum(3), isspace(3), iscntrl(3), ispunct(3), isprint(3), isgraph(3),
    isascii(3), toupper(3), toascci(3), _tolower(3), setchrclass(3), stdio(3)























  2                                              Intergraph Corporation - 2/94




Typewritten Software • bear@typewritten.org • Edmonds, WA 98026