设为首页 加入收藏

TOP

字符串转换篇
2012-02-01 13:26:19 】 浏览:1978
Tags:字符串 转换
toascii(将整型数转换成合法的ASCII 码字符)
相关函数
isascii,toupper,tolower
表头文件
#include<ctype.h>
定义函数
int toascii(int c)
函数说明
toascii()会将参数c转换成7位的unsigned char值,第八位则会被清除,此字符即会被转成ASCII码字符。
返回值
将转换成功的ASCII码字符值返回。
范例
#include<stdlib.h>
main()
{
int a=217;
char b;
printf(“before toascii () : a value =%d(%c)\n”,a,a);
b=toascii(a);
printf(“after toascii() : a value =%d(%c)\n”,b,b);
}
执行
before toascii() : a value =217()
after toascii() : a value =89(Y)
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇多进程编程 下一篇模拟Nginx网络IO模型

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目