我遇到了内存访问冲突,我无法弄清楚。我猜我的语法在某处可能是错误的。这是我的代码
load(double **pDouble)
{
int size;
//pStruct is returned by a method of some object inside load
// arr is an array of double, also member of struct pointed by pStruct.
size = sizeof(pStruct->arr)/sizeof(double);
*pDouble = new double[size];
for(int i = 0 ; i < size; i++)
{
*pDouble[i] = pStruct->arr[i];
//the violation occurs for the second iteration of
// the loop
}
}
什么可能导致访问冲突?