Chapter 17
Pointing the Way to C++ Pointers
In This Chapter
Introducing the concept of pointer variables
Declaring and initializing a pointer
Using pointers to pass arguments by reference
Allocating variable-sized arrays from the heap
This chapter introduces the powerful concept of pointers. By that I don’t mean specially trained dogs that point at birds but rather variables that point at other variables in memory. I start with an explanation of computer addressing, before getting into the details of declaring and using pointer variables. This chapter wraps up with a discussion of something known as the heap and how we can use it to solve a problem that I slyly introduced in the last chapter.
But don’t think the fun is over when this chapter ends. The next chapter takes the concept of pointers one step further. In fact, in one way or another, pointers will reappear in almost every remaining chapter of this book.
Get Beginning Programming with C++ For Dummies, 2nd 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.