#include <stdio.h> int main() { char ch; FILE *fp; if((fp = fopen("text.txt", "r")) != NULL) { while((ch = fgetc(fp)) != EOF){ putchar(ch); } }else{ printf("fail to open! "); } fclose(fp); return 0; }
估计题主是这个意思