Suggested new C loop syntax (was `if (a = b)')
Richard J Cox
maujt at warwick.ac.uk
Tue Jan 10 23:24:12 AEST 1989
In article <264 at twwells.uucp> bill at twwells.UUCP (T. William Wells) writes:
(stuff deleted)
>
> do
> statement
> while (expr);
> statement
>
>See the difference? Well, in case you didn't, it is the semicolon at
>the end of the while expression. This is damned hard to spot and does
>not lead to a syntax error.
>
>I'll stick to using a break.
>
>---
>Bill
>{uunet|novavax}!proxftl!twwells!bill
This is exactly the same as:
for(expr; expr; expr);
statment
which every C programmer has to be able to spot anyway - so whats the problem?
- RC
/*--------------------------------------------------------------------------*/
JANET: maujt at uk.ac.warwick.cu BITNET: maujt%uk.ac.warwick.cu at UKACRL
ARPA: maujt at cu.warwick.ac.uk UUCP: maujt%cu.warwick.ac.uk at ukc.uucp
Richard Cox, 84 St. Georges Rd, Coventry, CV1 2DL; UK PHONE: (0203) 520995
More information about the Comp.lang.c
mailing list