刚刚学习到文件,有不懂的地方?

jiarusun000 jiarusun000 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
新年快乐大家!

将一个磁盘文件中的数据复制到另一个文件中去?(书上的代码)

#include <stdio.h>
#include <stdlib.h>

void main(void)
{
FILE *in,*out;
char ch,infile[10],outfile[10];
printf("Enter your source file name:\n");
gets(infile);
printf("Enter your destination file name:\n");
gets(outfile);

if(in=fopen(infile,"r"))==NULL
{
printf("Cannot open the source file\n");
exit(1);
}
if(out=fopen(outfile,"w"))==NULL
{
printf("Cannot open the destination file\n");
exit(1);
}
while(feof(in)==0)
fputc(fgetc(in),out);
fclose(in);
fclose(out);
}

我是在win-tc下编译,错误提示:未定义个符号 FILE
是不是需要typedef 定义啊?
谢谢大家喽~
...全文
评论 10
收藏 已收藏
分享
返回顶部
jiarusun000
C语言 70,039 成员 243,237 内容