In C language, uppercase characters are represented by characters with smaller ASCII code values. The toupper() function converts characters to uppercase, while the tolower() function converts them to lowercase. Other related functions include isupper(), islower(), strupper(), and strlower(), which are used to check character case and convert strings to uppercase or lowercase respectively.
uppercase represents uppercase characters in C language
In C language, characters and strings are both Represented by ASCII code. The ASCII code value of uppercase characters and numbers is smaller than the corresponding lowercase characters and letters.
toupper() function
toupper() function converts uppercase characters to lowercase characters, and lowercase characters to uppercase characters. Its syntax is as follows:
<code class="c">int toupper(int ch);</code>
Where:
ch
: The characters to be converted. For example:
<code class="c">char ch = 'a'; toupper(ch); // ch 现在为 'A'</code>
tolower() function
tolower() function converts uppercase characters to lowercase characters, and lowercase characters to Uppercase characters. Its syntax is as follows:
<code class="c">int tolower(int ch);</code>
Where:
ch
: The characters to be converted. For example:
<code class="c">char ch = 'A'; tolower(ch); // ch 现在为 'a'</code>
Other related functions
C language also provides several other functions related to case conversion:
isupper()
: Check whether the character is an uppercase character. islower()
: Check whether the character is lowercase. strupper()
: Converts all lowercase characters in the string to uppercase characters. strlower()
: Converts all uppercase characters in the string to lowercase characters. The above is the detailed content of What does uppercase stand for in c language. For more information, please follow other related articles on the PHP Chinese website!