将一个文件从from.txt复制到to.txt
/*将文件from.txt的内容复制一份到to.txt*/
void chapter1::testCopyFile()
{
printf_s("复制文件测试开始\r\n");
FILE *f, *ft;
int r = fopen_s(&f,"D:\\000testprocess\\c_lesson\\Debug\\from.txt","rb");
r = fopen_s(&ft,"D:\\000testprocess\\c_lesson\\Debug\\to.txt", "wb");
char temp = fgetc(f);
while (!(feof(f)))
{
fputc(temp,ft);
temp = fgetc(f);
}
fclose(f);
fclose(ft);
printf_s("复制文件测试结束\r\n");
}