Chapter 7. (Downplaying) Pointers in Modern C++

Images

Objectives

In this chapter, you’ll:

Learn what pointers are, and declare and initialize them.

Use the address (&) and indirection (*) pointer operators.

Compare the capabilities of pointers and references.

Use pointers to pass arguments to functions by reference.

Use pointer-based arrays and strings mostly in legacy code.

Use const with pointers and the data they point to.

Use operator sizeof to determine the number of bytes that store a value of a particular type.

Understand pointer expressions and pointer arithmetic that you’ll see in legacy code.

Use C++11’s nullptr to represent ...

Get C++20 for Programmers, 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.