#包含" string.h "
void main()
{
FILE *fp,* FP 1;
字符串[200];
If ((FP = fopen ("new。txt "," wt")) = = null)/*假設新舊文本文件都是新的。txt和老。txt */
{
printf("無法打開文件\ n ");
返回;
}
if((fp1=fopen("old.txt "," rt"))==NULL)
{
printf("無法打開文件\ n ");
返回;
}
While (fgets (str,200,FP 1))//讀取壹行,判斷文件是否結束。
{
fprintf(fp," %s ",str);
}
fclose(FP 1);
fclose(FP);
}