qfedu-c-level/day14/d11.c

22 lines
332 B
C

#include <stdio.h>
// 文件复制
int main()
{
FILE *aF = fopen("d11.txt", "r");
if (NULL == aF)
{
perror("fopen");
return 1;
}
FILE *bF = fopen("d11_cpy.txt", "w");
int c;
while ((c = fgetc(aF)) != EOF)
{
fputc(c, bF);
}
fclose(aF);
fclose(bF);
return 0;
}