What is an Array?
An array is a sequence of objects all of which have the same variable type. Each storage location or object are called the elements of the array and are numbered in a row 0, 1, 2, 3, etc. These numbers are called index values of the array.
The syntax of an array is as follows:
 | |  | | |
Type array-name [array-size]; |
|  |
|
Where type is the array’s element type it could be replaced, for instance with: int, float, char, etc. (These terms will be explained later). The array-size is the number of elements in the array. Here is an example of a declaration of an array.
Explanation of declaration:
First off, the type of array is an integer, the array-name is anArray and finally the array-size has 5 elements. The next section will explain how elements are used in arrays.
Please Rate this Code: