+ 1

Sense of using 'this' ?

If we are able to complete our desired task without making a explicit call to 'this' then where is the need to use it?

28th Dec 2016, 6:47 PM
Pushpendra Singh Rathore
Pushpendra Singh Rathore - avatar
1 Odpowiedź
+ 3
The simplest case is to differentiate method arguments from object attributes. E.g.: void setName(name) { this->name = name; }
29th Dec 2016, 5:06 AM
Igor B
Igor B - avatar