用到了内存地址的知识
#include <iostream>
using namespace std;
int main() {
int a[2][3] = { 1,2,3,4,5,6 };
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 3; j++)
{
cout << *(*(a + i) + j) << endl;
}
}
return 0;
}
运行结果
1
2
3
4
5
6
用到了内存地址的知识
#include <iostream>
using namespace std;
int main() {
int a[2][3] = { 1,2,3,4,5,6 };
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 3; j++)
{
cout << *(*(a + i) + j) << endl;
}
}
return 0;
}
运行结果
1
2
3
4
5
6