Chapter 8
Taking a First Look at C++ Pointers
In This Chapter
Addressing variables in memory
Declaring and using pointer variables
Recognizing the inherent dangers of pointers
Passing pointers to functions
Allocating objects off the heap (whatever that is)
So far, the C++ language has been fairly conventional compared with other programming languages. Sure, some computer languages lack (il-)logical operators like those in Chapter 4, and C++ has its own unique symbols for things, but there’s been nothing new in the way of concepts. C++ really separates itself from the crowd in its use of pointer variables. A pointer is a variable that “points at” other variables. I realize that’s a circular argument, but suspend your disbelief at least until you can get into the chapter.
This chapter introduces the pointer variable type. It begins with some concept definitions, flows through pointer syntax, and then introduces some of the reasons for the pointer mania that grips the C++ programming ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access