printf 的一个奇怪现象!?
今天突然发现一个奇怪的现象,平常没注意过
程序代码:#include <stdio.h>
int main(void)
{
float a = 1.5 ;
float b = 2.4 ;
int c = 5 ;
printf("%f %f", a, b);
printf("%d %f", a, b);
printf("%f %f", c, b);
}其输出结果为:
1.500000 2.400000
0 0.000000
0.000000 0.000000
问题就来了,为什么第二个和第三个Printf中的a、c用%d、%f输出会影响到b用%f的输出呢,这感觉很奇怪啊~










这个很奇怪么?