c编程中fflush(stdin)的用法是什么
我有以下程序
#include <stdio.h>#include <stdlib.h>int main(){
char ans[8];
int i;
for(i=1;i<=3;i++)
{
printf("\n What is the unit of traffic ?");
scanf("%s",ans);
fflush(stdin);
if(stricmp(ans,"Earlang")==0)
{
printf("\nAnswer is correct");
exit(1);
}
else
if(i<3)
printf("\n Try Again!\n");
}
printf("\n Nunit of traffic is Earlang:");}fflush(stdin)在这个程序中有什么用?
繁华开满天机
墨色风雨
SMILET
随时随地看视频慕课网APP
相关分类