Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
135 views
in Technique[技术] by (71.8m points)

c++ - 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...