Home Segments Index Top Previous Next

370: Mainline

A one-dimensional array is a collection of places where objects are stored and retrieved using an integer index. Each object in an array is called an element of that array. In C++, the first element is indexed by zero; hence, C++ is said to have zero-based arrays.

The following, for example, is a one-dimensional array with integer elements:

   0     1     2     3     4        <-- Index 
*-----*-----*-----*-----*-----* 
|  57 |  72 |  94 |  22 |  35 | 
*-----*-----*-----*-----*-----*