What is this pointer? What is its Significance?

0 votes
199 views
asked May 31, 2013 in C++ by BasicQuestion (1,355 points)
What is this pointer? What is its Significance?

2 Answers

0 votes
answered May 31, 2013 by john (4,220 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 Jan 28, 2017 by anonymous

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
...