go to previous page   go to home page   hear noise   go to next page


Yes. (Actually, a good answer would be "sounds dangerous", because it is.)

Omitting the Test

When the test part of a for is omitted it is as if the value true were put in its place. So,

for ( initialize ;   ; change )
  loopBody ;

is the same as:

for ( initialize ;  true  ; change )
  loopBody ;

This is done for compatibility with the language "C" and should not be done in newly written programs. In truth, it should never have been done in "C".


Could all three parts be omitted from a for?