顾名思义:用来装指针的数组
#include <iostream> using namespace std; int main() { /**********************指针数组************************/ int arr[3] = {10,100,200}; int length = sizeof(arr) / sizeof(int); int *p_arr[3]; for(int i = 0;i < length;++i) { p_arr[i] = &arr[i]; } for(int i = 0;i < length;++i) { cout << "address : " << p_arr[i] << endl; cout << "value : " << *p_arr[i] << endl; } return 0; }
输出如下:
address : 0x61fef8
value : 10
address : 0x61fefc
value : 100
address : 0x61ff00
value : 200