First page Back Continue Last page Graphics
What is an Array?
What if we wanted to hold a large number of values?
- would require a large number of variables
- would make the program really messy to work with
- would cease to be “human readable” code
One answer is to use an array
- array: an indexed list of variables of the same type
- we can set the number of elements in the array
- each array is only one variable, but contains how ever many variables we need
- thus, code is much easier to read and work with when we only need to deal with single items that represent a larger amount of variables