#include<stdio.h>int main(int argc,char *argv[]) { FILE *src_fp,*des_fp; char buf[128]={0}; if(argc != 3) { printf("please input parameter\n"); return -1; } //打开源文件 src_fp = fopen(argv[1],"r"); if(src_fp == NULL) { printf("open the file %s is failure\n",argv[1]); return -1; } printf("open the file %s is success\n",argv[1]); //打开目的文件 des_fp = fopen(argv[2],"w"); if(des_fp == NULL) { printf("open the file %s is failure\n",argv[2]); return -2; } printf("open the file %s is success\n",argv[2]); //将源文件拷到目的文件中 while(1) { fgets(buf,128,src_fp); if(feof(src_fp)) { printf("the file is end\n"); break; } fputs(buf,des_fp); } //关闭文件流 fclose(src_fp); fclose(des_fp); return 0; }
共2条
1/1 1 跳转至页
标准行cp功能
共2条
1/1 1 跳转至页
回复
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
【STM32H7S78-DK评测】LVGL DMA2D/CPU搬运数据至framebuff性能比较被打赏50分 | |
【STM32H7S78-DK评测】LVGL适配之GuiGuider被打赏50分 | |
【STM32H7S78-DK评测】LVGL适配之触摸输入被打赏50分 | |
【STM32H7S78-DK评测】LVGL适配之LCD显示被打赏50分 | |
分享技术笔记六被打赏50分 | |
【开发板试用-NUCLEO-U575ZI-Q】定时器中断实现板载LED点亮被打赏50分 | |
分享技术笔记五被打赏50分 | |
【STM32H7S78-DK评测】LTDC Color Key功能验证被打赏50分 | |
请大声喊出:我要开发板!---使用esp32驱动AD7606C-18被打赏50分 | |
分享技术笔记四被打赏50分 |