您好,欢迎来到九壹网。
搜索
您的当前位置:首页文章的拷贝

文章的拷贝

来源:九壹网
1.文章(内容为字符)的拷贝。即将源文件拷贝到目的文件,两个文件名均由命令行给出,

源文件在前。

#include #include void main() {

FILE*in,*out;

char ch,infile[10],outfile[10]; printf(\"input the infile name:\\n\"); scanf(\"%s\

printf(\"input the outfile name:\\n\"); scanf(\"%s\

if((in=fopen(infile,\"r\"))==NULL) {

printf(\"can't open the infile\\n\"); exit(0); }

if((out=fopen(outfile,\"w\"))==NULL) {

printf(\"can't open the outfile\\n\"); exit(0); }

ch=fgetc(in); while(ch!=EOF) {

fputc(ch,out); ch=fgetc(in); } }

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- 91gzw.com 版权所有 湘ICP备2023023988号-2

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务