Abstract
You’ll often need to store many data values of a particular kind in your programs. In a program to track the performance of a basketball team, you might want to store the scores for a season of games and the scores for individual players. You could then output the scores for a particular player over the season or work out an ongoing average as the season progresses. Armed with what you’ve learned so far, you could write a program that does this using a different variable for each score. However, if there are a lot of games in the season, this will be rather tedious because you’ll need as many variables for each player as there are games. All your basketball scores are really the same kind of thing. The values are different, but they’re all basketball scores. Ideally, you want to be able to group these values together under a single name—perhaps the name of the player—so that you wouldn’t need separate variables for each item of data.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2013 Ivor Horton
About this chapter
Cite this chapter
Horton, I. (2013). Arrays. In: Beginning C. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-4882-8_5
Download citation
DOI: https://doi.org/10.1007/978-1-4302-4882-8_5
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4302-4881-1
Online ISBN: 978-1-4302-4882-8
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books