1、文件必须以二进制形式打开

FILE* pfileone=fopen("fileone","rb");

FILE* pfiletwo=fopen("filetwo","wb");

2、读取文件,并存放数据

char *buf;

int len=ftell(pfileone);

buf=new char[len+1];

fread(buf,1,len,pfileone);

3、写文件

fwrite(buf,1,len,pfiletwo);

4、结尾

delete buf;

fclose(pfileone);

fclose(pfilletwo);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2022-02-01
  • 2021-12-07
猜你喜欢
  • 2022-12-23
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
  • 2022-12-23
相关资源
相似解决方案