指针数组:array of pointers, 数组中的元素都是指针,例如 char *p[10];
数组指针:a pointer to an array, 一个指向数组的指针,例如 char (*p)[10];
#include<iostream>
#include<vector>
using namespace std;
int main()
{
char *p[10];
cout<<sizeof(p)<<endl;
cout<<p<<endl;
cout<<p+1<<endl;
char (*pt)[10];
cout<<sizeof(pt)<<endl;
return 0;
}
输出:
80
0x7fff5fbff7c0
0x7fff5fbff7c8
8
Program ended with exit code: 0