8.2. Arrays

An array is a group of variables (called elements) containing values that all have the same type. Array names follow the same conventions that apply to other variable names. To refer to a particular element in an array, we specify the name of the array and the position number of the element to which we refer. Position numbers are values that indicate specific locations within arrays.

Figure 8.1 shows a logical representation of an integer array called c. This array contains 12 elements, any one of which can be referred to by giving the name of the array followed by the position number of the element in parentheses (). The first element in every array is the zeroth element. Thus, the elements of array c are c(0), c(1), c(2) and so ...

Get Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition 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.