Some interesting novice questions from a novice guy

James C Burley burley at world.std.com
Sat Oct 27 20:09:17 AEST 1990


In article <2620 at cirrusl.UUCP> dhesi%cirrusl at oliveb.ATC.olivetti.com (Rahul Dhesi) writes:

   In <L3O6IN7 at xds13.ferranti.com> peter at ficc.ferranti.com (Peter da Silva) writes:

   >	while(*foo++)
   >		continue;

   I know I'm not a C guru, and maybe I'm the only one here who gets
   confused by autoincrement-right-after-dereferencing, but I have always
   hated that "continue" statement, because it bothers my intuition.  [...]
   --
   Rahul Dhesi <dhesi%cirrusl at oliveb.ATC.olivetti.com>

I agree.  So what's wrong with the simple solution I've learned (or been
taught) to use:

    while(*foo++)
      ;

Doesn't the dangling semi say enough?  (I do the same thing with my empty-
bodied for loops.)

James Craig Burley, Software Craftsperson    burley at world.std.com



More information about the Comp.lang.c mailing list