文件操作 报错 P252 江南大学 程序设计教材 todo
//文件操作 报错 P252 江南大学 程序设计教材 todo #include <stdio.h> #include <stdlib.h> int main(){ FILE *fp; int ch; if((fp=fopen("output.txt","rt"))!=NULL){ printf("\ncnnot open file strike any key exit!!!"); getch(); exit(1); } ch = getc(fp); while(ch != EOF) { putchar(ch); ch = fgetc(fp); } fclose(fp); return 0; }