My question refers to the case when I want to call other methods of the same class. Where's the difference of doing this with and without the use of 'this'? The same with variables of the class. Is there a difference accessing those variables through 'this'? Is it related to whether those methods / variables are private / public? Example:
class A {
private:
int i;
void print_i () { cout << i << endl; }
public:
void do_something () {
this->print_i(); //call with 'this', or ...
print_i(); //... call without 'this'
this->i = 5; //same with setting the member;
i = 5;
}
};