#include<stdio.h>
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");
}