Purtill@MIT-MULTICS.ARPA (Mark Purtill) (07/28/85)
<Fnord> >> while(ptr++->duck) /* move pointer to the duck after the next NULL */ >> ; >This one is even more obscure than the last. I am a C programmer, and >this tells me nothing - indeed it is dead wrong, as it simply will not >happen as the comment might lead me to believe. This will leave me >with ptr pointing to the next available record whose element named >duck is 0. No, remember that foo++ increments foo *after* it get's the value. So after the code fragment above is done, (ptr-1)->duck is 0, and ptr->duck is what ever it is. Incidentally, I would write this /* skip *past* first some_struct with NULL duck */ while( (some_struct_ptr++ -> duck) != NULL) ; /* next bit of code */, where some_struct is the name of the structure some_struct_ptr (formerly ptr) points to. The comment is mostly there because often when I have fred++, I really mean ++fred, so it's useful to point out (to me, mostly) that I really know what I'm doing. Mark ^.-.^ Purtill at MIT-MULTICS.ARPA **Insert favorite disclaimer here** ((")) 2-032 MIT Cambrige MA 02139