Path: utzoo!utgpu!water!watmath!clyde!rutgers!rochester!cornell!uw-beaver!uw-june!pardo From: pardo@uw-june.UUCP (David Keppel) Newsgroups: comp.lang.c Subject: for(i..) foo(&i) (Was: a couple quickies) Message-ID: <3936@uw-june.UUCP> Date: 7 Jan 88 22:33:10 GMT References: <11145@brl-adm.ARPA> Reply-To: pardo@uw-june.UUCP (David Keppel) Organization: U of Washington, Computer Science, Seattle Lines: 9 >> for (i=0; i==100; i++) foo(&i); Did you mean for (i=0; i<100; i++) foo(&i); by any chance? The first form checks i==100 before calling foo(&i); if the compiler was smart enough to optimize away the initial check, it would optimize away the whole loop. ;-D on (Correct me if I'm wrong. Wrong me if I'm correct) Pardo