想把一个文件内容传送到另一个文件中
#include
using namespace std;
int main()
{
FILE *pfile1 = NULL;
fopen_s(&pfile1,"F:\TestUpload\TestUpload.txt","r");
char buffer[100];
size_t i =0;
FILE * pfile2 = NULL;
fopen_s(&pfile2,"F:\\rec.txt","a");
size_t j = 0;
while(i=fread(buffer,1,10,pfile1))
{
fwrite(buffer,strlen(buffer),1,pfile2);
if(i<10)
{
cout << "文件读取完毕" << endl;
break;
}
}
cout << buffer << endl;
fclose(pfile1);
fclose(pfile2);
return 0;
}
这么写哪里错了?求解