This documentation is archived and is not being maintained.

12.3 Array element access

Visual Studio .NET 2003

Array elements are accessed using element-access expressions (Section 7.5.6.1) of the form A[I1, I2, ..., IN], where A is an expression of an array type and each IX is an expression of type int, uint, long, ulong, or of a type that can be implicitly converted to one or more of these types. The result of an array element access is a variable, namely the array element selected by the indices.

The elements of an array can be enumerated using a foreach statement (Section 8.8.4).

Show: