The this keyword is a special pointer often used in operator overloading and miscellaneous object oriented concepts. There is not much to tell about this keyword, which means that this tutorial will be a short one. Nevertheless, one needs a thorough understanding of what this keyword means to move on with the C++ language. This keyword is often used in operator overloading. But also in more exotic features like pointers to members.
Once again, the this keyword is not an intensive subject to study, so the code presented here will be very easy to understand. The previous version of this tutorial included an advanced code example using the Qt GUI library. I've removed that example because it is just to complex (at first sight) for less seasoned coders. There is no loss of information though. The Qt code was optional reading material anyway.
Prerequisites:
Very basic knowledge and handling of classes and it's instances (objects).
Basic understanding and handling of pointers.
Basic understanding and handling of functions. This includes passing parameters by value and by reference.
Every code snippet presented here is complete and ready to be copied into your console project. Only one *.cpp file is required.