用c语言实现文件的备份,语法感觉对了吗,但是不会执行。怎么办?
/*备份*/void BeiFen()
{
int ch;
FILE *fp;
FILE *dfp;
if((fp=fopen("book.txt","rb"))==NULL)
{
printf("文件打开失败!!\n");
}
else
{
if((dfp=fopen("book1.txt","wr"))==NULL)
printf("文件打开失败!!\n");
else
{
while((ch=fgetc(fp))!=EOF)
fputc(ch,dfp);
}
}
}