C style peeve and knowing the rules
Karl Heuer
karl at haddock.ima.isc.com
Mon Mar 26 09:21:26 AEST 1990
In article <19356 at megaron.cs.arizona.edu> robert at cs.arizona.edu (Robert J. Drabek) writes:
>In article <340018 at hplvli.HP.COM>, boyne at hplvli.HP.COM (Art Boyne) writes:
>>Also, 'while', 'for', 'if', etc., all *require* parenthesis...
>
>But as Joe Keane said, these constructs require the parenthesis for a
>particular reason and few people understand that reason.
There's one exception: in the do-while statement, the language definition
requires the parentheses even though there would be no syntactic difficulty
without them. (The semicolon would suffice to terminate the expression, just
as it does with return.)
Karl W. Z. Heuer (karl at ima.ima.isc.com or harvard!ima!karl), The Walking Lint)
More information about the Comp.lang.c
mailing list