Possible Duplicate:
What is the difference between the dot (.) operator and -> in C++?
What is the difference between the two? When do you use one instead of the other?
There was once I tried to use ‘->’ instead of ‘.’ and I got “left operand has ‘class’ type, use ‘.'” error, what does it mean?
The
.allows you to access members of a class.thingy.member, for example.If you have a pointer to your class, say
pThingy, you need to dereference it in order to access the members. Like(*pthingy).member.A shortcut to the dereference/access combination is
->:pThingy->member.