Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!tut.cis.ohio-state.edu!att!dptg!ulysses!andante!alice!ark From: ark@alice.att.com (Andrew Koenig) Newsgroups: comp.lang.c++ Subject: Re: FORever Message-ID: <11410@alice.att.com> Date: 30 Sep 90 17:16:43 GMT References: <1990Sep27.150948.9109@sco.COM> <212@dumbcat.sf.ca.us> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 35 In article <212@dumbcat.sf.ca.us>, marc@dumbcat.sf.ca.us (Marco S Hyman) writes: > Do you really want to break all the existing code that does something like > for (int i=10; i<13; ++i) { > if (x[i] == magicValue) { > break; > } > } > if (i >= 13) { > // we didn't find magicValue > } > Lots of C code uses this. I hope not -- it isn't legal C. C does not allow variables to be declared in `for' statements; instead one must write something like this: int i; for (i=10; i<13; ++i) { if (x[i] == magicValue) { break; } } if (i >= 13) { // we didn't find magicValue } The meaning of such things would not be affected by any change in the scope of C++ variables declared in `for' statements. -- --Andrew Koenig ark@europa.att.com