#include "stdafx.h"
#include <string>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
string s1="E://money//20170823-cs//8.jpg";
string s2="E://money//20170823-cs//7.jpg";
FILE *fp;
int size;
fp=fopen(s1.c_str(),"rb+");
fseek (fp, 0, SEEK_END);
size=ftell (fp);
rewind(fp);
char* data=(char *)malloc(sizeof(char)*(size+1));
fread(data,size,1,fp);
fclose(fp);
FILE *ff;
ff=fopen(s2.c_str(),"wb");
fwrite(data,size,1,ff);
free(data);
fclose(ff);
return 0;
}
![](https://img2024.cnblogs.com/blog/35695/202408/35695-20240826070647288-243310440.jpg)