课程
/后端开发
/C
/C语言入门
为什么不需要定义c,n,f,d?
2015-08-08
源自:C语言入门 2-8
正在回答
因为这里是吧字符型c转换成整形数而#define是直接给c定值就像上一节课的#define MONNEY 10, 但是这里是转换类型,只需要把c的值赋给n,f,d.
marvelous文 提问者
举报
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; }
2 回答为啥给n,f,d赋值是时候把c写成了'c'就变成99了?
3 回答#include <stdio.h> int main() { char c = 'a'; int n = c //将c赋值给n float f = n //将c赋值给f double d = f //将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; }