19.1 Array types

An array type is written as a non-array-type followed by one or more
rank-specifiers:
array-type:
non-array-type rank-specifiers
non-array-type:
type
rank-specifiers:
rank-specifier
rank-specifiers rank-specifier
rank-specifier:
[ dim-separatorsopt ]
dim-separators:
,
dim-separators ,
A non-array-type is any type that is not itself an array-type.
The rank of an array type is given by the leftmost rank-specifier in the
array-type: A rank-specifier indicates
that the array is an array with a rank of one plus the number of ?,? tokens
in the rank-specifier.
The element type of an array type is the type that results from deleting
the leftmost rank-specifier:
? An array type of the form T[R] is an array with rank R and a non-array
element type T.
? An array type of the form T[R][R1]?[RN] is an array with rank R and an
element type T[R1]?[RN].
In effect, the rank-specifiers are read from left to right before the final
non-array element type. [Example:
The type int[][,,][,] is a single-dimensional array of three-dimensional
arrays of two-dimensional
arrays of int. end example]
At run-time, a value of an array type can be null or a reference to an
instance of that array type.
C# LANGUAGE SPECIFICATION
276
19.1.1 The System.Array type
The type System.Array is the abstract base type of all array types. An
implicit reference conversion
(§13.1.4) exists from any array type to System.Array, and an explicit
reference conversion (§13.2.3) exists
from System.Array to any array type. System.Array is not itself an
array-type. Rather, it is a class-type
from which all array-types are derived.
At run-time, a value of type System.Array can be null or a reference to an
instance of any array type.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值