Let me explain.
t is a pointer to struct tm. Usually, to dereference a pointer you use the
* operator. So you think you'd be able to do
*t.tm_yday, but the
. operator has a higher precedence that the
* operator so what happens is it takes the
tm_yday member of the
t struct and then tries to dereference that. Clearly not what you actually want to do.
So in order to force the
* operator to happen before the
. operator you could do
(*t).tm_yday. And that's a perfectly valid way to do it. But some wise C guru decided that dereferencing a pointer to a struct was too common and too ugly that way to not have a better solution. That's where the
-> operator comes in.
(*t).tm_yday is the same as doing
t->tm_yday.
I hope that clears things up a bit