对二楼的补充。
#include<iostream>
using namespace std;
int main()
{
int a[4] = {1,2,3,5};
int b[3][4] = {1,5,6,66,6,6,6,6,6,6,6,5};
int(*p)[4];
p = &a;
p = b;
cout<< (*p)[11] <<endl;
return 0;
}
输出为 5
#include<iostream>
using namespace std;
int main()
{
int a[4] = {1,2,3,5};
int b[3][4] = {1,5,6,66,6,6,6,6,6,6,6,5};
int(*p)[4];
p = &a;
p = b;
cout<< (*p)[11] <<endl;
return 0;
}
输出为 5