S
skishorev
What is the use of This ptr.Follow the code snippet.
class this_pointer {
int data1;
public:
int getdata()
{
return this->data1;
}
void setdata(int newval)
{
data1 = newval;
}
};
Here two functions setdata and getdata. one is ' This Ptr', and one is
with out.
Exactly whats happening here. What is the use of This Pointer here.
Thanks &Regards,
Kishore.
class this_pointer {
int data1;
public:
int getdata()
{
return this->data1;
}
void setdata(int newval)
{
data1 = newval;
}
};
Here two functions setdata and getdata. one is ' This Ptr', and one is
with out.
Exactly whats happening here. What is the use of This Pointer here.
Thanks &Regards,
Kishore.