# 多维数组 (C)Multidimensional Arrays (C)

``````
expression1
[
expression2
] [
expression3
]...
``````

## 示例Examples

``````int prop[3][4][6];
int i, *ip, (*ipp)[6];
``````

`prop` 数组的引用如下所示：A reference to the `prop` array looks like this:

``````i = prop[0][0][1];
``````

``````i = prop[2][1][3];
``````

1. 第一个下标 `2` 乘以 4 x 6 `int` 数组的大小，然后与指针值 `prop` 相加。The first subscript, `2`, is multiplied by the size of a 4-by-6 `int` array and added to the pointer value `prop`. 结果将指向 `prop` 的第三个 4 x 6 数组。The result points to the third 4-by-6 array of `prop`.

2. 第二个下标 (`1`) 乘以 6 元素 `int` 数组的大小，然后与 `prop[2]` 表示的地址相加。The second subscript, `1`, is multiplied by the size of the 6-element `int` array and added to the address represented by `prop[2]`.

3. 6 元素数组的每个元素都是一个 `int` 值，因此最后一个下标 `3` 在与 `int` 相加之前将乘以 `prop[2][1]` 的大小。Each element of the 6-element array is an `int` value, so the final subscript, `3`, is multiplied by the size of an `int` before it is added to `prop[2][1]`. 生成的指针将寻址到 6 元素数组的第四个元素。The resulting pointer addresses the fourth element of the 6-element array.

4. 将对指针值应用间接寻址运算符。The indirection operator is applied to the pointer value. 结果是该地址处的 `int` 元素。The result is the `int` element at that address.

下面两个示例演示未应用间接寻址运算符的情况。These next two examples show cases where the indirection operator is not applied.

``````ip = prop[2][1];

ipp = prop[2];
``````