FILE *fp1,*fp2; fp1=fopen("./a.txt","r"); fp2=fopen("./b.txt","w"); char text[1024]; fgets(text,1024,fp1); fputs(text,fp2); fclose(fp1); fclose(fp2);