O'Reilly logo

The C++ Programming Language, Fourth Edition by Bjarne Stroustrup

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

7. Pointers, Arrays, and References

The sublime and the ridiculous are often so nearly related that it is difficult to class them separately.

– Thomas Paine

Introduction

Pointers

void*; nullptr

Arrays

Array Initializers; String Literals

Pointers into Arrays

Navigating Arrays; Multidimensional Arrays; Passing Arrays

Pointers and const

Pointers and Ownership

References

Lvalue References; Rvalue References; References to References; Pointers and References

Advice

7.1. Introduction

This chapter deals with the basic language mechanisms for referring to memory. Obviously, we can refer to an object by name, but in C++ (most) objects “have identity.” That is, they reside at a specific address in memory, and an object can be accessed ...

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