Like functions, arrays are one of the most important topics that we discuss in this class. One of a computer's main jobs is to process large quantities of data. Up until this chapter we created a variable to store each data value used in a program. Now we get to use arrays, a data structure that allows us to store multiple values in memory using a single variable name.
An array is a group of data, all of the same type, with one name. But how can we get a specific piece of data if they are all stored using the same variable name? This is achieved by using an index (subscript) which allows the programmer to access one particular value out of the group of values. The index also makes it easy to process arrays using loops, especially for loops, since the loop counter of the loop can be used as an index into the array.
All of the elements in a C++ array must be the same data type. If the array is multi-dimensional, all of the rows must be the same length, all of the columns must be the same length, etc.