Two-dimensional array,
Two-dimensional array
1,
The address of a [0] is the same as that of a [0] [0], because a [0] [0] is a [0] (because it is a two-dimensional array, so now a [0] is the first address of a pointer pointing to a one-dimensional array.
The address of a is the same as that of a [0] because a [0] is the first letter of a array.
The value of a [0] is the same as the address because a [0] is an array (also a pointer) and points to the address of the first element.
We can see the following one-dimensional array.
2. memory usage of two-dimensional arrays
Int a [3] [4] is a two-dimensional array consisting of three rows and four columns. It contains 12 units, each of which is 4 bytes and each byte is 8 bits, and the 12 units are continuous.
Two-dimensional array memory Representation
Note:
A + 1 = the address of a [1], that is, the address of a [1] [0] instead of the address of a [0] [1]
A [0] + 1 = address of a [0] [1]