O'Reilly logo

Sams Teach Yourself C++ in One Hour a Day, Seventh Edition by Siddhartha Rao

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

Lesson 4. Managing Arrays and Strings

In previous lessons, you declared variables used to contain a single int, char, or string to mention a few instances. However, you may want to declare a collection of objects, such as 20 ints or a litter of Cats.

In this lesson, you find out

• What arrays are and how to declare and use them

• What strings are and how to use character arrays to make them

• A brief introduction to std::string

What Is an Array?

The dictionary definition of an array gets really close to what we want to be understanding. According to Merriam Webster, an array is “a group of elements forming a complete unit, for example an array of solar panels.”

The following are characteristics of an array:

• An array is a collection of elements. ...

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