Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
toupper.c File Reference
#include <ctype.h>
Include dependency graph for toupper.c:

Go to the source code of this file.

Functions

int toupper (int c)
 Converts the given character to lowercase. More...
 

Function Documentation

◆ toupper()

int toupper ( int  ch)

Converts the given character to lowercase.

Converts the given character to lowercase according to the character conversion rules defined by the default local, i.e. the following lowercase letters (abcdefghijklmnopqrstuvwxyz) are replaced with respective uppercase letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ).

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters
chcharacter to be converted.
Returns
Uppercase version of ch or unmodified ch if no uppercase version is listed in the default locale.

Definition at line 5 of file toupper.c.

6 {
7  if(islower(c))
8  {
9  {
10  return c & 0x5f;
11  }
12  }
13  return c;
14 }
int islower(int ch)
Checks if the given character is classified as a lowercase character.
Definition: islower.c:5

References islower().

Referenced by towupper().

Here is the caller graph for this function: