- Array refers to a named list of a finite number of similar data elements.
- An array is a collection of the same type of data referenced by a common name.
- It is a collection of contiguous memory locations referenced by a common name.
- An array is a sequence of the data items of homogeneous value(same type).
- Each of the data elements can be referred by a set of consecutive numbers, usually 0, 1, 2, 3, 4, ………,n.
Examples
- Percentage mark of 100 students.
- The number of chairs in a home.
- Ages of 25 students.
Types of Array
- One dimensional array
- Two-dimensional arrays (Multidimensional arrays).
One dimensional array
- It is the simplest form of an array that can store a linear set of values with one subscript or one index.
Syntax
DATATYPE ARRAYNAME[SIZE];