An array of pointers: First it is an array, the elements of the array are pointers, and the number of bytes in the array is determined by the array itself . It is the abbreviation for "array of stored pointers". Second, array pointers: First it is a pointer to an array. The 32-bit system will always be 4 bytes, as to how many bytes it points to, not known. It is the abbreviation for "pointers to arrays". Eg: Which of the following is an array pointer, which is an array of pointers: a), an int *p1[10];--> pointer array b), an int (*P2) [10];--> array Pointer Resolution: First, it is necessary to understand the priority problem between a symbol. The
priority of "[]" is higher than "*" . P1 is first combined with "[]" to form the definition of an array, with the array named P1, and int * Decorated with the contents of the array, that is, each element of the array. So, this is an array that contains 10 pointers to data of type int, that is, an array of pointers. As for P2, it is better understood that the
precedence of "()" here is
higher than "[] ", "*" and P2 constitute a pointer definition, the pointer variable is named P2, and int modifies the contents of the array, that is, each element of the array. The array does not have a name here and is an anonymous array. So now we know that P2 is a pointer to an array that contains 10 data of type int, that is, an array pointer.
pointer arrays and array pointers