On 08/29/2014 02:08 PM, musikbear wrote: > diiz wrote >> On 08/28/2014 02:50 PM, musikbear wrote: >>> diiz wrote >>>> for (int i = 0; i < 1; i += step) >>>> This loop will either only iterate once, or it'll get stuck in infinite >>>> loop. Pop quiz... can you spot why? >>> var i was initated <1 >>> i<=1 should secure one cycle, and i belive a pre-increment would too >>> (cant >>> rem. the syntax :p >> Nope, that's not it. >> >> You fail the quiz musikbear ;) > trick question :p -asumed step was int==1 > Now i could argue - /wont compile 'step' is undefined :P/ > But just for clearing up /If/ step indeed was defined*int step = 1;* > then i would not be wrong -or?
For loops in C/C++ are always "loop while (condition)", not "loop until (condition)". ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ LMMS-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/lmms-devel
