首页 > 编程知识 正文

c库函数,c库函数常用

时间:2023-05-06 14:42:09 阅读:178279 作者:4135

头文件: #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; 呃! #$

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。