Aug 28, 2008 at 1:38pm UTC
In the following example:
TCNode *cptr = g_pStoreBase->StartCar;
do{
cptr->C->SetBusy();
cptr = cptr->Next;
}while(cptr);
...what is the general purpose for using '->' access operator in this 'do-while' statement? I was having trouble trying to interpret this info.
Aug 28, 2008 at 1:44pm UTC
a->b
is shorthand for (*a).b
So for each node (every node has a pointer to a Car? named C , which in turn has a pointer to a function) call that function.
:-\
Aug 28, 2008 at 2:04pm UTC
oh, okay...I wasn't used to seeing that '->' so many times in a program so it made it confusing to understand at first, but now it makes sense to me. Thanks!