来源:
ChinaUnix博客 作者: 发布时间:2007-01-01 12:04:00

#include
#include
int main()
{
char *sFile="e:\\test\\a.txt";
char *dFile="e:\\test\\b.txt";
char ch;
FILE *sfp,*dfp;
if ((sfp=fopen(sFile,"r"))==NULL)
{
printf("%s",sFile);
printf("源文档打开失败:%s",sFile);
exit(1);
}
if ((dfp=fopen(dFile,"w"))==NULL)
{
printf("目标文档打开失败:"+*dFile);
exit(1);
}
while ((ch=getc(sfp))!=EOF)
{
putc(ch,dfp);
}
fclose(sfp);
fclose(dfp);
return(0);
}
|
还没有关于此文章的相关评论!