An array is a collection of two or more values, all of which have the same type and share a single commonbasename. It makes no sense to have an array of just one value; that would simply be a variable. An array definition has the following syntax:
dataType arrayIdentifier[ numberOfElements ];
Here, dataType is any intrinsic or custom type, arrayIdentifier is the basename of the array, and numberOfElements specifies how many values of dataType are in the array. numberOfElements, for whatever type and values are given, will be converted into an integer. All the elements of the array are contiguous (or side-by-side) so that the size of the array is the size of each element multiplied by the number of elements in the array.
To declare an integer array of 10 elements, we would use the following statement:
int anArray[10];
anArray is the basename of our array of 10 integers. This declaration creates 10 variables...