我无法弄清楚为什么程序控制在 for 循环之后没有到达第三个 printf。
printf
为什么不打印第三张?
如果我将 for 循环更改为 while 循环,它仍然不会打印。
这是程序和输出:
main()
{
double nc;
printf ("Why does this work, nc = %f\n", nc);
for (nc = 0; getchar() != EOF; ++nc)
{
printf ("%.0f\n", nc);
}
printf ("Why does this work, nc = %f", nc);
}
输出是:
Why does this work, nc = 0.000000
test
0
1
2
3
4