double型的问题,为什么结果是这样的?
#include "stdio.h"void main()
{
double x=0.0;
double y;
scanf("%f",&x);
y=x;
printf("%1.4f",&x);
getch();
}
程序如上面。比如输入“1”,结果却是“0.0000”。
我怎么想不明白

看红色部分.
&关键是这个,刚才你把地址输出来了
#include "stdio.h"
void main()
{
double x=0.0;
double y;
scanf("%lf",&x);//%lf
y=x;
printf("%1.4lf",&x);//double是%lf
getch();
}
[此贴子已经被作者于2007-9-25 17:41:09编辑过]