Does anyone know what the this pointer is used for in C++? I'm learning about it but I can't seem to find a true purpose to it. I'd imagine I would just call member variables instead of go to the trouble of learning a whole 'nother method of pointers.
It allows you to explicitly access the current class. It can be used to avoid naming conflicts between say, a global variable and a member variable. It can also be used just for clarity to show that you are accessing members, but in most cases it is not necessary.