我是ANSI C的初学者,我有一个问题,这可能是一个愚蠢的问题,我很抱歉.
#include<stdio.h>
main()
{
int age;
printf("Hello World!\n");
printf("Please enter your age: ");
scanf("%d", &age);
printf("You entered %d\n", age);
fflush(stdin);
getchar();
}
Run Code Online (Sandbox Code Playgroud)
这是我学习scanf功能的第二个程序.我的问题是:我知道printf,scanf,fflush,stdin和getchar是在stdio.h中定义的,但只有当我使用fflush(stdin)时我必须把#include < stdio.h >,但是当使用任何其他方法时我可以删除该行#include.