Is "for(;;)" faster than "while (TRUE)"? If not, why do people use it?

Posted by Chris Cooper on Stack Overflow See other posts from Stack Overflow or by Chris Cooper
Published on 2010-04-09T22:04:48Z Indexed on 2010/04/09 22:13 UTC
Read the original article Hit count: 247

for (;;) {
    //Something to be done repeatedly
}

I have seen this sort of thing used a lot, but I think it is rather strange... Wouldn't it be much clearer to say while (TRUE), or something along those lines?

I'm guessing that (as is the reason for many-a-programmer to resort to cryptic code) this is a tiny margin faster?

Why, and is it REALLY worth it? If so, why not just define it this way:

#DEFINE while(TRUE) for(;;)

© Stack Overflow or respective owner

Related posts about c

    Related posts about c++