标题:[讨论]用fopen函数无法打开文件有哪几种情况
取消只看楼主
czl
Rank: 1
等 级:新手上路
帖 子:50
专家分:0
注 册:2007-7-1
 问题点数:0 回复次数:2 
[讨论]用fopen函数无法打开文件有哪几种情况

我这里有个文件复制的 函数 用的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);
}


搜索更多相关主题的帖子: fopen 函数 文件 FILE 
2007-11-08 12:49
czl
Rank: 1
等 级:新手上路
帖 子:50
专家分:0
注 册:2007-7-1
得分:0 

我都改了 可是 还是不行的 我用的dev-cpp 谢谢了 你讲的很详细 真的很感谢

2007-11-08 15:13
czl
Rank: 1
等 级:新手上路
帖 子:50
专家分:0
注 册:2007-7-1
得分:0 

弄好了 谢了啊

2007-11-10 02:01



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-184482-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.455808 second(s), 10 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved