O'Reilly logo

Sams Teach Yourself C++ in 24 Hours, Third 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

What's the this Pointer For?

If that's all there is to the this pointer, there would be little point in bothering you with it. The this pointer, however, is a pointer, which means it stores the memory address of an object. As such, it can be a powerful tool.

You'll see a practical use for the this pointer later in the book, when operator overloading is discussed (in Hour 14). For now, your goal is to know about the this pointer and to understand what it is: a pointer to the object itself.

You don't have to worry about creating or deleting the this pointer. The compiler takes care of that.

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