Johnnylo
2016-02-12 18:01
#include <stdio.h>
int main()
{
char c = 'a';
int n =c; //将c赋值给n
float f =c; //将c赋值给f
double d =c; //将c赋值给d
printf("%d\n",n);
printf("%f\n",f);
printf("%lf\n",d);
return 0;
}这里为什么运行结果会是97呢?明明没有任何数据类型定义为97的呀、、
在ASCII码中,字符'a'就等于十进制数97.
C语言入门
928159 学习 · 21543 问题
相似问题