標簽:常用函數 c語言 printf input int 英文字母 英文 cte 返回值
演示版本
VS2013
toupper()函數用于把小写字母转换为大写字母,不是小写字母的不变。
語法
int toupper(int ch);
toupper()函數的語法参数说明如下:
參數ch爲待轉換的字符。
toupper()函數的返回值:转换后的字符。
示例
本示例演示用toupper()函數把小写字母转换为大写字母。其具体代码如下:
#include <stdio.h> #include <ctype.h> int main() { char ch1, ch2; printf("input a character\n"); scanf_s("%c", &ch1); ch2 = toupper(ch1); printf("transform %c to %c\n", ch1, ch2); return 0; }
阿飛
2021年7月28日
C語言常用函數-toupper()將字符轉換爲大寫英文字母函數
標簽:常用函數 c語言 printf input int 英文字母 英文 cte 返回值
原文地址:https://www.cnblogs.com/nxopen2018/p/15072957.html