C ctype toupper() Function
Example
Convert a character to uppercase:
char l = 'a';
char u = toupper(l);
printf("%c in uppercase is %c", l, u);
Try it
Yourself »
Definition and Usage
The toupper()
function returns the ASCII value of an uppercase version of
the character. If the
character is not an uppercase character then its value is returned without being changed.
The toupper()
function is defined in the <ctype.h>
header file.
Syntax
int toupper(int c);
Parameter Values
Parameter | Description |
---|---|
c | Required. The ASCII value of a character or an actual character |
Technical Details
Returns: | An int value representing the ASCII value of the
uppercase version of a character. |
---|