/*-------------------------一维数组------------------------*/ int Ary[3] = {3, 2, 1}; int *pInt = Ary; //指向int变量的指针,Ary的值代表第一个元素的地址,此时*pIn=3 int (*pIntAry)[3] = &Ary; //指向int数组的指针 int a1 = pInt [0]; //引用数组的元素,a1=3 int a2 = (*pIntAry)[0]; //引用数组的元素,a2=3 /*-------------------------二维数组------------------------*/ int Ary[3][4] = {{0, 2, 3, 4}, {1, 0}, {2, 1}}; int (*pIntAry1)[4] = Ary; //指向一维int数组的指针,Ary的值代表数组第一个元素的地址,而第一元素为包含4个元素的int数组,此时*pIntAry1={0, 2, 3, 4} int (*pIntAry2)[3][4] = &Ary;//指向二维int数组的指针 int a1[4] = {(*pIntAry1)[0], (*pIntAry1)[1], (*pIntAry1)[2], (*pIntAry1)[3]}; //或者 int a1[4] = {*(*pIntAry1 + 0), *(*pIntAry1 + 1), *(*pIntAry1 + 2), *(*pIntAry1 + 3)}; int a2[4] = {(*pIntAry2)[0][0], (*pIntAry2)[0][1], (*pIntAry2)[0][2], (*pIntAry2)[0][3]}; //或者 int a2[4] = {(**pIntAry2)[0], (**pIntAry2)[1], (**pIntAry2)[2], (**pIntAry2)[3]};