Professional Documents
Culture Documents
Arrays
Arrays 1 2 3 4
• An array can contain a number of values while a simple data type can only
contain a single value. This is why an array is a data structure.
• The contents of each of the individual elements must be of the same data type,
for example all strings or all integers.
• The positions of the elements of the array must be numbered by an enumerated
type such as Integer or Char. These are known as indices of the elements.
Non-enumerated types such as Real and String cannot be used as an index for an array.
• We refer to a specific element in the array by using the name of the array as well
as the index of the element in the array. E.g arrMark[10]
Declaration of an array
var
arrName : array[Lower bound .. Upper bound] of <data type>;