this -> x = x signifies what ?
Please explain this
Basically we can use this keyword to refer to data members of our object
And incase constructor have same argument names as that of data members then this can be used to point to data member
So here assum
class ABC{
int x;
ABC(int x){
this->x=x; //here this->x points to class x
//and RHS x is local argument u are receiving
}
}
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.