为什么delete时会报错
源代码如下:
void main()
{
int i,j;
double **p;
p=new double*[1000];
for (int m=0;m<5000;m++)
{
p[m]=new double[5000];
}
clock_t beg, end;
double time;
beg=clock();
for (i=0; i<1000; i++)
{
for (j=0; j<5000; j++)
{
p[i][j]=0.5;
}
}
for (i=0; i<1000; i++) {
for (j=0; j<5000; j++) {
p[i][j]=p[i][j]*p[i][j]+2.0*p[i][j]+10.0;
}
}
end=clock();
time=(double)(end-beg)/CLOCKS_PER_SEC;
printf("Compute time is %f seconds\n",time);
for (int n=0;n<5000;n++)
{
delete[] p[n];
}
delete[] p;
}
报错:file:dbgdel.cpp
line:47
Expression:_BLOCK_TYPE_IS_VALID(pHesd->nBlockUse)