0 votes
asked in C++ by (1.4k points)
What is this pointer? What is its Significance?

2 Answers

0 votes
answered by (4.2k points)

           The this pointer is an object pointer which points to the currently calling object, The this pointer is, by default, available to each called member function.

0 votes
answered by

The this pointer is a way to access the current instance of particular object. It can be used for several purposes:

  • as instance identity representation (for example in comparison to other instances)
  • for data members vs. local variables disambiguation
  • to pass the current instance to external objects
  • to cast the current instance to different type