Array is a collection of homogeneous or same type members. For example, array can be of integer, float or even structure type. It is created by simply specifying its size as subscript along with variable name. For example, int a[5];
Memory allocated to an array is equal to the memory taken by its base type multiplied by the number of elements. Let us consider the memory allocated to a[5]
a3
The array elements are indexed starting from 0 to n-1, where n is the size of array. Each element can be accessed using the index number.

Advertisements