Go to main content

man pages section 3: Basic Library Functions

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

toupper(3C)

Name

toupper, toupper_l - transliterate lowercase characters to uppercase

Synopsis

#include <ctype.h>

int toupper(int c);
int toupper_l(int c, locale_t locale);

Description

The toupper() and toupper_l() functions have as a domain a type int, the value of which is representable as an unsigned char or the value of EOF. If the argument has any other value, the argument is returned unchanged. The toupper() function operates in the current locale as set by setlocale(3C), while toupper_l() uses the locale represented by the locale argument.

If the argument of toupper() or toupper_l() represents a lowercase letter, and there exists a corresponding uppercase letter as defined by character type information in the locale category LC_CTYPE, the result is the corresponding uppercase letter. All other arguments in the domain are returned unchanged.

The behavior is undefined if the locale argument to toupper_l() is the special locale object LC_GLOBAL_LOCALE or is not a valid locale object handle.

Return Values

On successful completion, toupper() and toupper_l() return the uppercase letter corresponding to the argument passed. Otherwise, they return the argument unchanged.

Errors

No errors are defined.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
CSI
Enabled
Interface Stability
Standard
MT-Level
MT-Safe

See Also

tolower(3C), _toupper(3C), duplocale(3C), freelocale(3C), newlocale(3C), setlocale(3C), uselocale(3C), attributes(7), standards(7)