【发布时间】:2011-04-22 09:32:28
【问题描述】:
#include <cstdio>
int main()
{
int i;
printf("%d", scanf("%d", &i));
}
无论我输入什么数字,我都会得到输出:
1
为什么会这样?
【问题讨论】:
-
<cstdio>是 C 标准标头。 -
@DeadMG- 你太可笑了。
Each header from the C Standard Library is included in the C++ Standard Library under a different name, generated by removing the .h, and adding a 'c' at the start。这个问题是 C 和 C++ 特定的。