A two-dimensional array has two subscripts
to identify each element.
Example:
The three monthly sales totals
for six salesmen are set up in a two-dimensional array called 'SALES'.
|
January |
February |
March |
John
Sykes |
£450 |
£320 |
£520 |
Linda
Judge |
£180 |
£220 |
£460 |
Sam
Good |
£620 |
£650 |
£710 |
Lynn
Horton |
£460 |
£420 |
£380 |
Jim
Talbot |
£120 |
£210 |
£190 |
Lucy
King |
£420 |
£380 |
£550 |
There are 6 rows and 3
columns.
(The grey
headings are not part of the array - they are headings for us to
understand the meaning of the array)
SALES[2,1] would be '£650' (Row 3, Column 2).
|