Site MapHelpFeedbackChapter Summary
Chapter Summary
(See related pages)

    1. A series of variables with the same name and data type is called an array. The individual values are referred to as elements, and each element is accessed by its subscript, which is a position number.
    2. Array subscripts or indexes are zero based; they must be integers in the range of the array elements. Noninteger values are rounded.
    3. You can assign initial values in the array declaration or specify the number of elements.
    4. A special form of the for loop called foreach is available for working with arrays. The foreach eliminates the need for the programmer to manipulate the subscripts of the array.
    5. You can declare a structure to combine related fields and then declare variables and arrays of the structure. The struct statement must appear at the class level.
    6. Array elements can be used like any other variables; they can be used to accumulate a series of totals or to store values for a lookup operation.
    7. The information in arrays may be accessed directly by subscript, or a table lookup may be used to determine the correct table position.
    8. You can use the SelectedIndex property of a list box as a subscript of an array.
    9. Arrays may be multidimensional. A two-dimensional table contains rows and columns and is processed similarly to a one-dimensional array. Accessing a multidimensional array frequently requires the use of nested loops.







Programming in Visual C# 2005Online Learning Center

Home > Chapter 8 > Chapter Summary