Home / Object Oriented Programming / What is this pointer? Provide necessary usage of THIS pointer.

What is this pointer? Provide necessary usage of THIS pointer.

What is this pointer? Provide necessary USAGE of THIS pointer.

In C++, this is a keyword that refers to the current instance of the class.

There can be 3 usages of this keyword in C++

  • It can be used to refer current instance of the class.
  • It can be used to declare indexes.
  • It can be used to pass current object as a parameter to another method.