Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does this mean "->"?

Ive almost only programmed in objective-c, for a couple of months ago I programmed a little in box2d and say this "->". Now what does that mean? its cant be objective-c it must be from c++ because box2d is c++, I one time saw someone using it in objective-c code and I just couldn't seem to understand what it did. Google doesn't support non-text characters so its impossible for me to google it since I don't know what it is.

like image 302
Arbitur Avatar asked Aug 15 '13 11:08

Arbitur


1 Answers

The -> operator is shorthand for deferencing and then accessing a member.

Given

type *a;

(*a).b is equivalent to a->b

More information here, en.wikipedia.org/wiki

like image 143
Jonny Avatar answered Oct 17 '22 21:10

Jonny