Namespaces
Variants
Views
Actions

this pointer

From cppreference.com
< cpp‎ | language
Revision as of 11:07, 6 March 2012 by P12 (Talk | contribs)

Template:cpp/language/sidebar

Inside non-static member function, holds a pointer to the class object from which the function was invoked.

The type of Template:cpp pointer is cv T* const where T is the class name and cv refers to the cv specifiers of the function the pointer is used in. For example:

Function signature Type of Template:cpp Template:cpp Template:cpp
Template:cpp Template:cpp
Template:cpp Template:cpp
Template:cpp Template:cpp

Example

Template:source cpp