‘this’ usually refers to the instance of the object that calls a particular method of a class,union,structure or a function.
when you have same names for different variables, then ‘this’ is used to differentiate between them.
class stu
{
int roll_no;
string name;
public:
void input(int roll_no,string name)
{
name=this->name;
roll_no=this->roll_no;
}
}
stu obj=new stu();
obj.input("47","harry");
Here, the ‘this’ tells that the ‘name’ is of the ‘obj’ that calls the method. Thus ‘this’ specifies the instance of the variable which belongs to the class object.
Also remember, when you want answers to theoretical questions, try to google them first.
Hope this helps.
solved What does the this pointer mean? [duplicate]