O'Reilly logo

Think Like a Programmer by V. Anton Spraul

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3SOLVING PROBLEMS WITH ARRAYS

image

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required