[英]Expression _BLOCK_TYPE_IS_VALID(pHead->nBlockUse) Error
[英]_BLOCK_TYPE_IS_VALID(pHead->nBlockUse) Error
我在下面的代碼的最后一行發現了錯誤“ _BLOCK_TYPE_IS_VALID(pHead-> nBlockUse)”:
pixelCoorindateAndThreePoint* tempSpace = new pixelCoorindateAndThreePoint[possibleMaxSize];
while (sscanf(temp, "%f %f", &cam1x, &cam1y)){
location = (int)(file->length*cam1y + cam1x);
file->cam1cam2ThreeDPoints[(int)(file->length*cam1y + cam1x)] = new pixelCoorindateAndThreePoint;
sscanf(temp, "%*f %*f %f %f %f %f %f \n",
&(tempSpace->PixelCoordinateCam2.x),
&(tempSpace->PixelCoordinateCam2.y),
&(tempSpace->threePoints.x),
&(tempSpace->threePoints.y),
&(tempSpace->threePoints.z));
file->cam1cam2ThreeDPoints[location] = tempSpace;
tempSpace++;
temp = strtok(NULL, "\n");
}
delete[] tempSpace;
為什么會出現這樣的錯誤? 由於我已將這些指針值復制到file->cam1cam2ThreeDPoints
,因此我應該能夠刪除tempSpace
。
tempSpace++;
更改指針。 您需要記住最初分配的指針,以使用它來調用delete
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.