a style question

Karl Heuer karl at haddock.ima.isc.com
Wed Oct 3 14:15:11 AEST 1990


In <1990Oct2.192727 at IASTATE.EDU> john at IASTATE.EDU (Hascall John Paul) writes:
>In <18370 at haddock.ima.isc.com>, karl at haddock.ima.isc.com (Karl Heuer) writes:
>>[Problems if it's unsigned; suggested ways to fix]
>
>I suppose this is so hideous that I shall be cursed forever for it...  ;-)
>        unsigned int   x;
>        for (x = 100; (int)--x > 0; )

Um, the "100" in this discussion is really just a placeholder for whatever the
iteration count happens to be--and it would be nice if the algorithm would
also work when the count is in the high range of an unsigned int.

Karl W. Z. Heuer (karl at kelp.ima.isc.com or ima!kelp!karl), The Walking Lint



More information about the Comp.lang.c mailing list