April 2010
Intermediate to advanced
976 pages
23h 2m
English
This chapter returns to the subject of C#’s data types. It discusses arrays and the string type. The foreach loop is also examined.
An array is a collection of variables of the same type that are referred to by a common name. In C#, arrays can have one or more dimensions, although the one-dimensional array is the most common. Arrays are used for a variety of purposes because they offer a convenient means of grouping together related variables. For example, you might use an array to hold a record of the daily high temperature for a month, a list of stock prices, or your collection of programming books.
The principal advantage of an array is that it organizes data in such a way that it can be easily manipulated. ...
Read now
Unlock full access