this Pointer in C++

C++ uses a unique keyword called “this” to represent an object that invokes a member function. ‘this’ is a pointer that points to the object for which this function was called. This unique pointer is called and it passes to the member function automatically. The pointer ‘this’ acts as an implicit argument to all the member function. Example: The private variable ‘a’ can be used directly inside a member function, like We can also use the following statement to do the same job. Example: Here this pointer is used to…

Read More