this pointer in C++
C++ uses a unique keyword called this to represent an object that invokes a member function. this pointer in C++ is a pointer that points to the object for which this function was called. For example, the function call: A.max() will set the pointer this to the address of the object A. The starting address is the same as the address of the first variable in the class structure. This unique pointer is automatically passed to a member function when it is called. The pointer this acts as an implicit argument to all the member functions. Consider the following simple example: class ABC { int a; … … }; The private variable a can be used directly inside a member function, like: a = 123; We can also use the following statement to do the same job: this -> a = 123; Since C++ permits the use of shorthand form...