Why sir used this-> v=v

why sir used this-> v=v

image

hello @anubhavb11
here we have two variable with same name v.

so to distinguish it we are using this pointer.

this->v =v ;
means assign value of local variable v to member variable v.

1 Like