4 Arrays and Their Areas of Use
“Those who fall out of line form the beginning of a new line.”—Erhard Horst Bellermann (1937–) [ 101 ]
In the programs you saw in previous chapters, variables stored exactly one value. In this chapter, we will see that there can be a collection of values behind a variable. We call these simple collections arrays .
4.1 Simple Field Work
An array is a special data type that combines several values into one unit, like a display case in which the compartments are numbered consecutively. The elements are addressed via an integer index . Each compartment (for Smurfs, for example) always takes values of the same type (only Smurfs, no Pokémon). Normally, the compartments of an array (its elements) are located ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access