Re: while (1) vs. for ( ;; )
- From: Ben Pfaff <blp@xxxxxxxxxxxxxxx>
- Date: Sun, 28 Aug 2005 19:46:46 -0700
Chris McDonald <chris@xxxxxxxxxxxxxxx> writes:
> Michael B Allen <mba2000@xxxxxxxxxx> writes:
>
>>Should there be any preference between the following logically equivalent
>>statements?
>
>> while (1) {
>>vs.
>> for ( ;; ) {
>
>>I suspect the answer is "no" but I'd like to know what the consensus is
>>so that it doesn't blink through my mind anymore when I type it.
>
> Preference? Why not move on to something whose intention is clear:
>
> while(true) {
In what way are the former two statements' intentions not clear?
Both of them obviously loop "forever".
--
A competent C programmer knows how to write C programs correctly,
a C expert knows enough to argue with Dan Pop, and a C expert
expert knows not to bother.
.
- Follow-Ups:
- Re: while (1) vs. for ( ;; )
- From: Chris McDonald
- Re: while (1) vs. for ( ;; )
- References:
- while (1) vs. for ( ;; )
- From: Michael B Allen
- Re: while (1) vs. for ( ;; )
- From: Chris McDonald
- while (1) vs. for ( ;; )
- Prev by Date: Re: pointers
- Next by Date: Re: const int value changing....
- Previous by thread: Re: while (1) vs. for ( ;; )
- Next by thread: Re: while (1) vs. for ( ;; )
- Index(es):
Relevant Pages
|