Arrays:


An array can be defined as a finite ordered set of homogeneous elements. By the term ‘finite’ we mean that there is a specific number of elements in an array. By the term ordered we mean that elements of array are arranged in a sequence so that first, second, third….., nth element can be identified. The homogeneous property of array means that all elements in the array must be of the same type. It is used to handle large amount of data, without the need to declare many individual variables separately. The array elements are stored in contiguous memory locations (i.e. one after the other). All the array elements must be either of any data types like int, float, char, double etc. or they can be of any user-defined data types like structures and unions.
Arrays can be classified in to two categories:
1.      One-dimensional arrays: A single subscript is required to access one-dimensional array. E.g. a[10].
2.      Multidimensional arrays: Two subscript are required to access two-dimensional array.
E.g. a[10][10].



Previous                                                                                    Next


Powered by Blogger.