动态二维数组的传递实现--函数调用

 

int main()
{
    int n=3;int m=3;
    int **A=new int *[n];
    for(int i=0;i<n;i++)
        A[i]=new int [m];//动态生成矩阵A
    com( A );    //调用函数com
    return 0;
}

int com(int **A)
{
   printf("%d\n",A[2][2]);
return 0;

}    

通过上面几条核心代码实现二维数组的传递

 

 

 

 

 

 

posted @ 2013-02-26 23:01  liang_l  阅读(2084)  评论(0编辑  收藏  举报