In the previous chapter, we limited ourselves to scalar variables, that is, variables that can hold only one value at a time. In this chapter, we’ll look at problems using the most common aggregate data structure, the array. Although arrays are simple structures with fundamental limitations, their use greatly magnifies the power of our programs.

In this chapter, we will primarily deal with actual arrays, that is, those declared with the built-in C++ syntax, such as:

int tenIntegerArray[10];

However, the techniques we discuss apply just as well to data structures with similar attributes. The most common of these structures ...

Get Think Like a Programmer now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.