I need to understand this
pointer concept, preferably with an example.
I am new to C++, so please use simple language, so that I can understand it better.
this
is a pointer to an instance of its class and available to all non-static member functions.
If you have declared a class, which has a private member foo
and a method bar
, foo
is available to bar
via this->foo
but not to "outsiders" via instance->foo
.