课程
/后端开发
/C
/C语言入门
为啥给n,f,d赋值是时候把c写成了'c'就变成99了?
2015-11-07
源自:C语言入门 2-8
正在回答
'c'的ASCII码编号是99,所以'c'和99是等价的,以%d输出字符型变量'c',也可以输出99
可以查查字符的ASCLL码表。
举报
C语言入门视频教程,带你进入编程世界的必修课-C语言
2 回答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; }
1 回答#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; }
1 回答#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; }
2 回答#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; }
4 回答#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; }