69,382
社区成员
发帖
与我相关
我的任务
分享
FILE *fp;
if((fp=fopen("test.txt","w"))==NULL)
{
qDebug()<<"open file failed!";
return;
}
int fileSize=msg[0];
char *buf;
buf=(char *)malloc(sizeof(fileSize)+1);
memset(buf,0,fileSize+1);
memcpy(buf,(char *)&msg[1],fileSize);
fwrite((char *)&msg[1],fileSize,1,fp);
fclose(fp);