In Chapter 7, we used the
array class template to represent fixed-size lists and tables of values. Here we present built-in arrays, which are also fixed-size data structures.
To specify the type of the elements and the number of elements required by a built-in array, use a declaration of the form:
The compiler reserves the appropriate amount of memory. The arraySize must be an integer constant greater than zero. For example, to tell the compiler to reserve 12 elements for built-in array of
c, use the declaration
int c; // c is a built-in array of 12 integers
array objects, you use the subscript (
) operator to access the ...