O'Reilly logo

C++ Without Fear: A Beginner’s Guide That Makes You Feel Smart by Brian Overland

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

5 Arrays: We’ve Got Their Number

The last couple of chapters have had a theme: once you define a task (no matter how simple or how complex) you can ask the computer to perform it any number of times. We’ve seen this principle at work in while loops and for loops, as well as functions. It’s this fact—more than any other—that demonstrates the power of computer software.

But the magic of computers lies not just in the fact they can perform an arbitrarily large number of repetitions. They can also work on arbitrarily large amounts of data.

An “array” is an arbitrarily large collection of data indexed by number. With a few keystrokes—as you’ll see in this chapter—you can create array data structures of any size. Then, by using loops, you can process ...

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