int main() { FILE *fp,*fp1; char ch[]={}; if ((fp=fopen("/User/Apple/Desktop/text.1","r"))==NULL) { printf("cannot open file\n"); return 0; } else {fp1=fopen("/User/Apple/Desktop/text.2", "w"); while(!feof(fp)) { fread(ch, 1,1,fp); fwrite(ch,1,1,fp1); } fclose(fp1); fclose(fp); } return 0; }
时间: 2024-10-15 16:48:42