You are on page 1of 3

this pointer

C++ provides a unique pointer called


this pointer. The pointer called this points
to the objects itself. Whenever a member
function is called, this pointer is
automatically passed to the called member
function as an implicit, in-built argument.
Characteristics of this pointer :-

 this pointer is an implicit parameter of a


member function. It points to the object on
which the function is invoked.
 this pointer is a pointer to the class type.
Therefore it can be used to access the
data members of the object.
 It can also be used to access the address
of the class object for which the member
function is called.
 In a const member function, this pointer is
a pointer to const.

 A static member is part of its class but not


part of an object. Therefore a static
member function does not have
a this pointer.

 Overloaded operators that are member


functions have an implicit this parameter
bound to the first operand.

 this pointer is not modifiable.

You might also like