1:toascii() 函数说明:
检查参数c,转换为7位的unsigned char值,再转成 ASCI码字符
2:函数原型:
int toascii(int c):
3:函数参数:
参数c,为检测整数
4:返回值:
返回转换成功的ASCI码字符值
5:示例:
#include <stdlib.h>
int main(){
int a=217;
char b;
printf("before toascii():a value=%d \n",a);
b=toascii(a);
printf("after toascii():a value=%d(%c) \n",b, b);
return 0;
}
6:输出结果:
可参考ASCII码对照表:https://mp.csdn.net/mp_blog/creation/editor/141003932
可参考ASCII码函数,进行验证:https://mp.csdn.net/mp_blog/creation/editor/141038486