toupper() function converts lowercase letters to uppercase letters. Syntax: int toupper(int c) Parameters: c - the character to be converted Return value: uppercase letter or c itself is only valid for letters in the ASCII character set locale-aware, the conversion may vary depending on the locale
Usage of toupper() function in C language
##Usage of toupper() function:
The toupper() function converts lowercase letters to uppercase letters.Syntax:
<code class="c">int toupper(int c);</code>
Parameters:
Return value:
Example:
<code class="c">char c = 'a'; char upper = toupper(c); printf("小写字母 %c 的大写字母是 %c\n", c, upper);</code>
Output:
<code>小写字母 a 的大写字母是 A</code>
Notes:
The above is the detailed content of How to use toupper in C language. For more information, please follow other related articles on the PHP Chinese website!