An array is used to store a collection of data items which are all of
the same type.
An individual element of an array is accessed by its index, which must
be an integer. The first element in the array has index 0.
When arrays are declared they must be given an integer number of
elements. This number of elements must be known to the compiler at the
time the array is declared.
If an attempt is made to access an element with an out of range index
then an unpredictable error can occur. Always ensure that array indices
for elements of arrays are in range when verifying the correctness of
your programs.
Arrays can be initialised when they are declared.
When an array is passed as a parameter to a function then it is passed
as a reference parameter. Hence any changes made to the array inside
the function will change the actual array that is passed as a parameter.
Character strings are represented by arrays of characters. The string
is terminated by the null character. In declaring a string you must set
the size of the array to at least one longer than required to hold the
characters of the string to allow for this null character.
Strings can be input and output via the input and output streams,
cin and cout.