السلام عليكم
لو سمحتوا ممكن حد يشرح لي ما عمل وما فائده استخدام المؤشر This مع الكائنات
كما في :
class test
{
private:
int x;
public:
test ( int =0);
void print()const;
};
test::test(int a)
{
x=a;
}
void test::print()const
{
cout<<"x = "<<x<<endl;
cout<<"This -> ="<<this->x<<endl;
cout<<"*this ="<<(*this).x<<endl;
}