toupper, _toupper [ HP C/iX Library Reference Manual ] MPE/iX 5.0 Documentation
HP C/iX Library Reference Manual
toupper, _toupper
Converts a lowercase letter to uppercase.
Syntax
#include <ctype.h>
int toupper (int c);
Parameters
c An argument to be converted to uppercase.
Return Values
x The uppercase letter that corresponds with c. If c is not
a lowercase letter and the function is called, c is
returned unchanged. If c is not a lowercase letter and the
macro is called, the results are undefined.
Description
This conversion routine that upshifts ASCII characters is implemented
both as a function and as a macro. The toupper function and _toupper
macro have a domain the range of getc() (the integers from -1 through
255). If the argument passed in c represents an lowercase letter,
toupper() returns the corresponding uppercase letter. All other
arguments in the domain are returned unchanged.
The _toupper macro accomplishes the same thing as the function, but has a
restricted domain and is faster. The _toupper macro requires a lowercase
letter as its argument. Arguments outside the domain cause undefined
results.
NOTE The toupper function and macro do not work with foreign character
sets.
Examples
The following code fragment might appear in the scanner of a
case-insensitive compiler, where all source input is mapped to uppercase
before any processing is performed.
unsigned char *ps;
while (*ps != '\0'){
*ps = toupper(*ps);
&+&+ps;
}
See Also
tolower(), ANSI C 4.3.2.2, POSIX.1 8.1
MPE/iX 5.0 Documentation