Knowledge of C pointer and C pointer
1. Summarize the knowledge of C pointer.
Level 1 pointer, one-dimensional array, array pointer
The array name of a one-dimensional array is a pointer, for example, int a [4] = {0}; a is equivalent to an int * p =.
Level 2 pointer, two-dimensional array, pointer Array
Two-dimensional array int aa [2] [3] = {0 }.
At this time, int ** pp = aa cannot be used, but it should be ** aa during access.
In fact, the first dimension of a two-dimensional array is int (* AB) [3]. It is a pointer array, not an array pointer.
In this case, int (AB) [3] is different from int *, so int (* AB) is used to accept two-dimensional arrays ). [3] = aa, the second-level pointer int ** pp = aa cannot be used. In this case, AB is the same as aa.
The pointer array is in the form of int * AB [3]. AB is first combined with [] to form a one-dimensional array,
The elements of this array are all int * pointers, so they are called pointer arrays. In this case, int ** p = AB can be used. Because the second-level pointer can only point to the position where int * is stored, and the array is an int * element, the array pointer is a second-level pointer, the two-dimensional array cannot be directly used as a second-level pointer.
It is a one-dimensional pointer array int (* AB) []. This pointer array is first interpreted as a pointer (* AB), then an array that stores int elements.
You can use this pointer AB to access the first element of * AB; (* AB) [1] The second element.
2. The concepts of function pointer array and pointer pointing to function pointer array are studied.