这道题为什么float 跟double 的输出都是97.000000,float不是4个字节吗输出不是应该是97.0000吗?求解
#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;
}
#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;
}
2016-11-20
举报