void show() {
FILE* fp;
int ch;
int stupos = 0;
fp = fopen("C:\\Users\\ALIENWARE\\Desktop\\student.txt", "r");//以r模式打开文件
if (!fp)
return;
while (EOF != (ch = fgetc(fp))) {
if (ch == 10) {
stupos++;
}
putchar(ch);
}
TotalCount = stupos;
printf_s("一共有%d名学生", TotalCount);
fclose(fp);
}
到底是哪里导致死循环了呢?
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-