O'Reilly logo

SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION by Jesse Liberty

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

Pointers, References, and Arrays

Astute readers will recall seeing something like the preceding definitions earlier in the book—for instance, in the arguments to main():

char* argv[]

Or the argument to UserWantsToContinueYorN():

char *theThingWeAreDoing

But what is the meaning of * in these definitions? In a definition, * should be read as “pointer to,” so we can read these two lines as “pointer to an array of characters” and “pointer to a character,” respectively.

Figure 13.3 shows how pointers “point” to storage on the heap.

Figure 13.3. Pointers have a location in the heap as their value.

* is also a prefix operator that can be used outside ...

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