|
楼主 |
发表于 2005-5-25 19:11:27
|
显示全部楼层
the function "fflush" has no effect.
for example:
#include <stdio.h>
int main()
{
char c,d[10];
int i=0;
scanf("%s",d);
fflush(stdin);
while((c=getchar())!='\n')
i++;
printf("%s\n",d);
printf("%d\n",i);
}
the result of the above program is:
# ./test
abcd
abcd
0
#
Please help me to solve the problem that clear the keyboard-buffer~,and thanks |
|