首页 > 代码库 > C++二维数组的new、delete

C++二维数组的new、delete

int** pNum;

pNum = new int*[M];

for(int i=0;i<M;i++)

{

 pNum[i]=new int[N];

}

 

//删除的时候是

for(int j=0;j<M;j++)

{

 delete []pNum[j];

}

delete []pNum;

C++二维数组的new、delete