1. One-dimensional array of one-dimensional array names, representing two (1) representing the entire array (although Tan Don's book says no, but only in that context) (2) represents the first address
2. Two-dimensional array
It is troublesome to think of a two-dimensional array in terms of pointers, so I think of a way of understanding it myself, as shown in
the meaning of the two-dimensional array name feels uncomfortable, so find out what it stands for.
Here's my Code and the results
You can see that their four values are exactly the same, but with different meanings.1.b array name, which is a pointer to the entire array,2.*b is the initial address of the first dimension of the array, equivalent to b[0]3.&b purpose is to see the address of the array name, the final result is obvious, his address is also this4.&b[0][0] The address of the first element of the array
In summary, at the same address, there are three pointers (1) that refer to the array-name pointer for the entire array, respectively. (2) B[0 to the first-dimensional address]. (3) The address of the first element of the first dimension, that is, an array
so the two-dimensional array name can represent the meaning:
(1) The entire array, as long as the output sizeof (array name), output the length of the entire array(2) pointer to the first dimension(3) can also represent the address of the first element (since they are the same) int *p=a;
"C-language exploration" two-dimensional arrays, meaning of two-dimensional array names