#include<iostream>
#include<type_traits>
#include<typeinfo>
#include<cstring>
using namespace std;
using A = int[4];
int main()
{
int a[3][4] = { {1,2,3,4},{1,2,3,4 },{1,2,3,4} };
auto pt1 = a;//pt1->int(*)[4]
while (pt1 != end(a))
{
auto pt2 = begin(*pt1);//pt2->int*
while (pt2 != end(*pt1))
{
cout << *pt2 << endl;
pt2++;
}
pt1++;
}
}
指针遍历二维数组
最新推荐文章于 2024-07-22 14:12:09 发布