1. Don't say much, first on the code:
#include <iostream>using namespacestd;intMainvoid){ intv[2][5] = {{1,2,3,4,5},{6,7,8,9,Ten}}; int(*a) [5] = V;//pointer array, pointer to array a[5],a[5] inside is an int value the pointer equals v addresscout<< (*a+1) <<endl;//*a is the address of v[0][0]. 0x22fe04cout<< (*a+2) <<endl;//Output 0x22fe08cout<<* (*a+2) <<endl;//value of a[0][1] 3cout<<* (A +1) <<endl;//the address of the output V[1][0]. 0x22fe14cout<<** (A +1) <<endl;//a[1][1] = 6 intb[3]={ One, A, -}; cout<<"one-dimensional arrays:"<<Endl; cout<<b<<endl;//b[0] Address 0x22fe30cout<< (b +1) <<endl;//b[1] Address 0x22fe34cout<< (&b+1) <<endl;//LossAddress of the pointer pointing to B +sizeof (B[3]): 0x22fe3ccout<<* (b +1) <<endl;// Acout<<* (&b+1) <<endl;//The output is 0x22fe3c, the output is his address value (only remember first!!) )cin.Get(); return 0;}
2. The difference between an array of pointers and arrays:
Array of pointers: Int (*p) [3]; The pointer points to an array, and P is a pointer to the array p[3].
Array pointer: int p[3]; Array memory to data is pointer
----------is a bit like the pointer constant constant in the pointer, who first executes who reads first, then determines the specific meaning according to the direction of the reading.
The use of a two-dimensional pointer array and an array pointer-------a written-C + + paper