主题:[讨论]帮我解释下一条语句的意思
#include <stdio.h>
int main(void)
{
int a;
while (scanf("%d", &a) != 1) {
printf("Input errror,try again:");
for (int ch; (ch = getchar())!='\n' && ch != EOF;)
continue;
}
printf("%d\n", a);
return 0;
}
帮我解释下这条语句:for (int ch; (ch = getchar())!='\n' && ch != EOF;) 谢谢了`````
int main(void)
{
int a;
while (scanf("%d", &a) != 1) {
printf("Input errror,try again:");
for (int ch; (ch = getchar())!='\n' && ch != EOF;)
continue;
}
printf("%d\n", a);
return 0;
}
帮我解释下这条语句:for (int ch; (ch = getchar())!='\n' && ch != EOF;) 谢谢了`````