I’m looking over some code and I came across some syntax that I don’t know the meaning of. What does the ‘->’ mean?
-(void) getTransformValues:(struct transformValues_*) tv
{
tv->pos = positionInPixels_;
tv->scale.x = scaleX_;
tv->scale.y = scaleY_;
tv->rotation = rotation_;
tv->skew.x = skewX_;
tv->skew.y = skewY_;
tv->ap = anchorPointInPixels_;
tv->visible = visible_;
}
The arrow operator (‘->’) is used in the same place you would use the dot operator (‘.’), but with a pointer to a structure instead of an object of that structure.
If you created an object of that structure, you would use the dot operator in order to access its members:
However, if you a pointer to a structure, instead of the structure itself, you could only use the arrow operator, or a little bit more complex dot operator:
As I said above, you could still use the dot operator:
Of course, all of this discussion involves a lot more topics, such as pointers, the heap, etc. Hope this helps.