有int arr[rows][cols]
//先释放a[i]
for (int i=0; i<rows;i++)
{
delete[cols] arr[i];
arr[i]=NULL;
}
delete[] arr; //最后释放arr
有int arr[rows][cols]
//先释放a[i]
for (int i=0; i<rows;i++)
{
delete[cols] arr[i];
arr[i]=NULL;
}
delete[] arr; //最后释放arr