#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;
}

posted on 2017-08-27 18:49  baraka  阅读(1751)  评论(0编辑  收藏  举报