C H A P T E R 12
Arrays
- Arrays
- Types of Arrays
- An Array as an Object
- One-Dimensional and Rectangular Arrays
- Instantiating a One-Dimensional or Rectangular Array
- Accessing Array Elements
- Initializing an Array
- Jagged Arrays
- Comparing Rectangular and Jagged Arrays
- The foreach Statement
- Array Covariance
- Useful Inherited Array Members
- Comparing Array Types
Arrays
An array is a set of uniform data elements represented by a single variable name. The individual elements are accessed using the variable name together with one or more indexes between square brackets, as shown here:
Array name Index
↓ ↓
MyArray[4]
Definitions
Let's start with some important definitions having to do with arrays in C#.
- Elements: The individual ...
Get Illustrated C# 2012 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.