Saturday, April 18, 2009

What Is an Array?

A scalar variable is a
named location in which to store a value; similarly, an array is a named place to store a
set of values, thereby allowing you to group scalars.
Bob’s product list will be the array for our example. In Figure 3.1, you can see a list
of three products stored in an array format and one variable, called products, which
stores the three values. (We’ll look at how to create a variable like this in a minute.)
After we have the information as an array, we can do a number of useful things with it.
Using the looping constructs from Chapter 1, we can save work by performing the same
actions on each value in the array.The whole set of information can be moved around as
a single unit

No comments:

Post a Comment