代码是用mfc写的 太长了
大家帮我分析分析 或者猜一猜 就好了
#include <stdio.h> int main() { int m = 0, n = 0; FILE *fp; fp = fopen("test.txt", "r"); //test.txt 内容 :aa while (!feof(fp)) fgetc(fp), ++m; fclose(fp); fp = fopen("test.txt", "r"); while (fgetc(fp) != -1) ++n; fclose(fp); printf("m = %d, n = %d\n", m, n); //m = 3, n = 2 return 0; }