我已经弄清楚它是什么了,它是char*字符串行的东西。我使用它来分解字节,以获得这个用于学校作业的pdf文件。
任何和所有的帮助是感激的!
void* consumer(void *temp)
{
int* stuff = reinterpret_cast<int*>(temp);
int x = *stuff;
char* string[];
stringstream stream1;
stringstream stream2;
int temp1=0;
int temp2=0;
int sent1=0;
int sent2=0;
ofstream fout;
strcpy(string,request); //SEGFAULT(11) ON THIS LINE, WHEN CALLING "string"
strcat(string,"Byte Range: ");
...发布于 2012-11-28 09:06:47
你还没有用于字符串指针的new内存,访问它是未定义的行为。
// char* string[]; I guess that's not what you intent to do, declaring an array of pointers?
char* string = new char[BIG_ENOUGH_SIZE];
strcpy(string, request);https://stackoverflow.com/questions/13596052
复制相似问题