关于new和delete的问题,求大侠指导
#include <iostream.h>#include <stdlib.h>
int **s,**m;
void main()
{
int i,j,w;
cin>>w;
m=new int*[w];
for(i=1;i<=w;i++)
{
m[i]=new int[w];
}
s=new int*[w];
for(i=1;i<=w;i++)
{
s[i]=new int[w];
}
for(i=1;i<=w;i++)
{
delete m[i];
delete s[i];
}
delete []m;
delete []s;
}
当程序执行到释放m和s的空间时就会出现调试错误,不知道问题所在,请各位高手帮帮忙。