#include<iostream>
using namespace std;
void main(){
    int a=5,b=6;int i,j;
int   **c  =   new   int*[b];
for( i=0;i<b;i++)
        c[i]   =   new   int[a];
//使用时用   arData[i][j]格式     0 <=i <nHeight,   0 <=j <nWidth

//结束时清除
cout<<c<<endl;
for(i=0;i<b;i++)
  for(j=0;j<a;j++)
      c[i][j]=i+j;
for(i=0;i<b;i++)
{ for(j=0;j<a;j++)
      cout<<c[i][j]<<",";
  cout<<endl;
}
cout<<c[2][2]<<endl;
 for(  i=0;i<b;i++)   
        delete[] c[i];
 //delete []c;
 cout<<c[2][2]<<endl;



}

posted on 2013-02-23 14:54  叶城宇  阅读(124)  评论(0编辑  收藏  举报