1 #include<iostream>
2 #include <vector>
3 using namespace std;
4
5 int main()
6 {
7
8 int ia[3][4] = {1,2,3,4,5,6,7,8,9,10,11,12};
9 int(*p)[4] = ia;
10 p = &ia[1];
11
12
13 //cout << ia[1][2] << endl;
14 //cout << p[1][3] << endl;
15
16 /*
17 **p ---->ia[0][0]的值
18 *p ---->第一行的含4个整数的数组的首元素的首地址,即ia[0][0]的地址
19 p ----> 外层第一行的首地址
20 */
21 for (auto p = ia; p != ia + 3; ++p)
22 {
23 for (auto q = *p; q != *p+4; ++q)
24 {
25 cout << *q<<' ';
26 }
27 cout << endl;
28
29 }
30
31 for (auto p = begin(ia); p != end(ia); ++p)
32 {
33 for (auto q = begin(*p); q != end(*p); ++q)
34 {
35 cout << *q << ' ';
36 }
37 cout << endl;
38 }
39
40 cout<<"hello"<<endl;
41 system("pause");
42 return 0;
43 }