In a function definition there is the possibility to
1 2 3 4 5 6 7 8 9 10 11 12 13 14
class Class
{
private:
int a;
public:
Class(int);
}
Class::Class(int num)
{
this.a = num;
this->a = num;
}
What is the difference and why might both work?
As I know "->" points to the object of the adress delivered by "this"
if
this = &ClassInstance
this->a (would point to a member of the object pointed to by this)
but if
this = &ClassInstance
this.a (would point to a member of a address...and a address doesnt has any member structures or something like that...its a plain number)