Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!genrad!panda!talcott!harvard!seismo!brl-tgr!tgr!Purtill@MIT-MULTICS.ARPA From: Purtill@MIT-MULTICS.ARPA (Mark Purtill) Newsgroups: net.lang.c Subject: Re: Style, etc. Message-ID: <217@brl-tgr.ARPA> Date: Sat, 27-Jul-85 20:43:00 EDT Article-I.D.: brl-tgr.217 Posted: Sat Jul 27 20:43:00 1985 Date-Received: Wed, 31-Jul-85 00:57:20 EDT Sender: news@brl-tgr.ARPA Lines: 26 >> 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