Skip to main content

Arrays

  • Chapter
Beginning C
  • 13k Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 49.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints 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

Publish with us

Policies and ethics