65,186
社区成员




#include "stdio.h"
#include <iostream>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
using namespace std;
int main()
{
FILE* fpUpload = NULL;
if (NULL == (fpUpload = fopen("update", "r"))) {
printf("errno=%d \n", errno);
}
fseek(fpUpload, 0, SEEK_END);
int64_t size = ftell(fpUpload);
fseek(fpUpload, 0, SEEK_SET);
char* pBuff = new char(size+1);
if (NULL == pBuff) {
printf("error \n");
}
memset(pBuff, 0, size+1);
int readsize = fread(pBuff, 1, size, fpUpload);
// pBuff[size] = '\n';
delete pBuff;
}
char* pBuff = new char(size+1);
->
char* pBuff = new char[size+1];