#include void maino FILE fpl, fp2 fpl= fopen(" e l\name. txt'","r"),/*只读打开文件name:txt* fp2=fopen("e: \name. bak","w") while(! feof(fpl)) putchar(getc(fpl)); rewind(fpl) /*重新定位文件指针到文件头* while( feof(fpD)) utc(getc(fp l), fp2) fclose(fp1); fclose(fp2)
#include void main() { FILE*fp1,*fp2; fp1=fopen("e:\\name.txt","r"); /*只读打开文件 name.txt*/ fp2=fopen("e:\\name.bak","w"); while(!feof(fp1)) putchar(getc(fp1)); rewind(fp1); /*重新定位文件指针到文件头*/ while(!feof(fp1)) putc(getc(fp1),fp2); fclose(fp1); fclose(fp2); printf("\n"); }