Hello World, I have been wondering why in c++ we use the this->ObjectName instead of this.ObjectName when referring to an object in c++. This is a simple syntax using the this->ObjectName :
int x = 34;
void take(int x) {
this->x = x;
}
But in other programming languages like java, we use :
int x = 34;
void take(int x) {
this.x = x;
}
So what am asking is why does the this statement in c++ differ from the this statement in java