Code:void Person::setname(string name) { Person::name = name; cout<<Person::name; }I know this(keyword) is a pointer that points to the current object that has called setname function.Code:void Person::setname(string name) { this->name = name; cout<<Person::name; }
But I want to know what's the difference between using
Person::name and this->name.



1Likes
LinkBack URL
About LinkBacks



