实例3.c
来自「几个用c语言写的关于文件的操作的源程序。」· C语言 代码 · 共 29 行
C
29 行
#include <stdio.h>
#include <stdlib.h>
main(int argc, char *argv[])
{
FILE *in,*out;
char ch;
if(argc!=3);
{
printf("You forgot to enter a filename\n");
exit(0);
}
if( (in=fopen(infile,"r") )==NULL)
{
printf("cannot open infile\n");
exit(0);
}
if( (out=fopen(outfile,"w") )==NULL)
{
printf("cannot open outfile\n");
exit(0);
}
while( ! feof(in) ) fputc(fgetc(in),out);
fclose(in);
fclose(out);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?