in reply to while() {}

Probably because while() and for(;;) are also infinite loops in C (according to MS's compiler and gcc).

I use for (;;) regularly and read it as "for ever". Perl6 will provide loop { } for that.

Update: I can't reproduce my earlier results. I must have confused my for (;;) test results for those of the while () test.

Replies are listed 'Best First'.
Re^2: while() {}
by kappa (Chaplain) on Feb 26, 2008 at 22:53 UTC
    I get this trying to compile while() ; with gcc 4.1.3:
    % LANG=C cc 1.c 1.c: In function 'main': 1.c:2: error: expected expression before ')' token
    --kap
      Yes - it's a syntax error with gcc-3.4.5 and Visual Studio 7.0, too. (I think ikegami is mistaken about this.)

      Cheers,
      Rob