|
|
|
|
|
|
|
|
|
|
|
v |
When
a variable is indexed it is called an array
|
|
|
v |
Arrays
are used for representing collections of data
|
|
values,
e.g. integers, strings, etc.
|
|
|
|
For
example: dwarf(0) = “Sneezy”
|
|
|
|
dwarf(1)
= “Dopey”
|
|
|
|
dwarf(2)
= “Grumpy”
|
|
|
|
...
|
|
|
v |
Elements
of an array must all be of the same type
|
|
|
v |
The
index of an array element is also known as a
|
|
|
subscript
|
|