Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site 3comvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!decwrl!Glacier!oliveb!3comvax!mikes From: mikes@3comvax.UUCP (Mike Shannon) Newsgroups: net.lang.c Subject: C bites / programming style Message-ID: <165@3comvax.UUCP> Date: Fri, 23-Aug-85 13:37:13 EDT Article-I.D.: 3comvax.165 Posted: Fri Aug 23 13:37:13 1985 Date-Received: Sun, 25-Aug-85 00:40:28 EDT Distribution: net Organization: 3Com Corp; Mountain View, CA Lines: 14 With regard to: if(condition); /* the bug is the seimcolon on this line */ statement; /* this statement was intended to be * executed iff the condition was true */ -------------------- I avoid getting bitten in this way by ALWAYS using {}'s after if, while, etc. Even when I have a null statement as the body of an while or for, I do it this way: for(i = 0; i < MAX; i++) { } Always using braces with if/else also removes ambiguity concerning "which if an else belongs to." -Michael Shannon (hplabs!oliveb!3comvax!mikes)