Hızlı yanıt: kod örneği
stackoverflow.com what-does-the-operator-mean-in-c
It's a shortcut for dereference followed by property access (or method invocation).In code, here are some examples of this equivalence:This is especially convenient when you have a long sequence of these. For example, if you have a singly linked list data structure in which each element has a pointer to the next, the following are equivalent ways of finding the fifth element (but one looks much nicer):
Foo *foo;// field accessfoo->bar = 10;(*foo).bar = 10;// method invocationfoo->baz();(*foo).baz();
linked_list *head, *fifth;fifth = head->next->next->next->next;fifth = (*(*(*(*head).next).next).next).next;