- what is this...???
Ok working on a little sprite animation in allegro for the first time. Acording to my reading material i have to build my own data structures to simulate my own animations.
Ok here's the part i don't know. In the sample code the use this symbol:
->
OK I know for a fact this already looks like a total noob quest on my part but what does this do exaclty? Also can i change the direction? <-
thanks in advance!
operator-> is used to access members through a pointer:
Similarly, you could dereference the pointer and use operator.:
(*object).member = 1;
And no, <- is not a valid operator.
Further reading.
class obj{public:int member;}int main(){obj *object = new obj();//access member of objectobject->member = 1;delete object;return 0;}
Similarly, you could dereference the pointer and use operator.:
(*object).member = 1;
And no, <- is not a valid operator.
Further reading.
"->" Is use to access an element of a class or struct via a pointer.
For example:
And to your second question, no you cannot reverse the arrow.
For example:
struct foo{int a;};...foo* f = new foo;// You can write:foo->a = 10;// Or you can write:(*foo).a = 10;
And to your second question, no you cannot reverse the arrow.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement