Chapter 1

Working with Arrays, Pointers, and References

In This Chapter

arrow Working with arrays and multidimensional arrays

arrow Understanding the connection between arrays and pointers

arrow Dealing with pointers in all their forms

arrow Using reference variables

When the C programming language, predecessor to C++, came out in the early 1970s, it was a breakthrough because it was small. C had only a few keywords. Tasks like printing to the console were handled not by built-in keywords but by functions.

Technically, C++ is still small. So what makes C++ big?

  • The language itself is small, but its libraries are huge.
  • The language is small, but it’s extremely sophisticated, resulting in millions of things you can do with the language.

In this chapter, we give you the full rundown of topics that lay the foundation for C++: arrays, pointers, and references. In C++, these items come up again and again.

We assume that you have a basic understanding of C++ — that is, that you understand the material in Book I and Book II, Chapter 1. You know the basics of pointers and arrays (and maybe just a teeny bit about ...

Get C++ All-in-One For Dummies, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.