Mail Archives: djgpp/1997/05/10/15:04:34
John Fremlin wrote:
> This is ugly, C already has a nice keyword for doing this:
>
> for( int wait = 0; wait < 5000; wait++ )
> {}
>
> Second, the compiler might optimize this out to:
>
> int wait = 5000;
Shouldn't even do that -- in the new C++ spec (which gcc now supports),
variables defined inside of a for loop are local to that loop. So
for (int wait = 0; wait < 5000; wait++) ;
wait = 0;
should give you an error.
--
Erik Max Francis, &tSftDotIotE / email / max AT alcyone DOT com
Alcyone Systems / web / http://www.alcyone.com/max/
San Jose, California, United States / icbm / 37 20 07 N 121 53 38 W
\
"The future / is right there."
/ Bill Moyers
- Raw text -