头文件: #include ctype.h
函数定义: inttoupper(intc );
函数说明:如果参数c是小写,则返回相应的大写字母。
返回值:返回转换后的大写字母,如果不需要转换,则返回参数c的值。
示例:将s字符串中的小写字符转换为大写字符。
#includectype.hmain((chars ) )='abcdefgh12345; 呃! #$ '; int i; printf(beforetoupper ) :%s(n ),s ); for(I=0; Isizeof(s; I ) s(I )=toupper ) s ) I ); printf(aftertoupper ) ) : %sn ),s ); }执行结果:
before toupper (: abcdefgh 12345; 呃! #$
aftertoupper(3360abcdefgh12345; 呃! #$