#include<iostream>
using namespace std;
int main() {
//使用指针创建二维数组
int arrys[5][3] = {
{ 1, 2, 3 }, { 4,5,6 }, { 7,8,9 },{10,11,12},{13,14,15} };
int (*p2)[3] = arrys;//3是数组的列,定义二维指针
int i, j;
for (i = 0; i < 5; i++) {
for (j = 0; j < 3; j++) {
cout << *((*p2 + i) + j)<<‘,‘;
}
cout << endl;
}
}
原文:https://www.cnblogs.com/qq1480040000/p/12633130.html