当前位置: 代码迷 >> C语言 >> 1
  详细解决方案

1

热度:380   发布时间:2005-05-31 20:10:00.0
1
1

[此贴子已经被作者于2005-5-31 21:21:52编辑过]



----------------解决方案--------------------------------------------------------
1

[此贴子已经被作者于2005-5-31 21:22:17编辑过]



----------------解决方案--------------------------------------------------------

有几个地方的fpa,fpb 搞混了,putchar(fgetc(fb))你还有个括号没括!程序如: #include "stdio.h" main() { FILE *fpa,*fpb; if((fpa=fopen("a.txt","r"))==NULL) {printf("error1a");exit(0);} if((fpb=fopen("b.txt","w"))==NULL) {printf("error1b");exit(0);}

while(!feof(fpa)) fputc(fgetc(fpa),fpb);

if(fclose(fpa)||fclose(fpb)){printf("error2a'or'b");exit(0);}

if((fpb=fopen("b.txt","r"))==NULL) {printf("error1b");exit(0);}

while(!feof(fpb)) putchar(fgetc(fpb)); if(fclose(fpa)){printf("error2b");exit(0);}

}




----------------解决方案--------------------------------------------------------
  相关解决方案