我这里有个文件复制的 函数 用的dev-cpp 却是无法打开 老是 this file can not open
#include <stdio.h>
void filecopy(FILE*in,FILE*out);
int main()
{
FILE *in;
FILE *out;
if((in=fopen("d1.dat","r"))==NULL)
{
printf("this file can not open");
exit(0);
}
if((out=fopen("d2.dat","w"))==NULL)
{
printf("this file can not open");
exit(0);
}
filecopy(in,out);
fclose(in);
fclose(out);
return 0;
}
void filecopy(FILE*in,FILE*out)
{
char ch;
ch=fgetc(in);
fputc(ch,out);
}