Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

FWIW, GCC and Perl generate the same code for both.

http://stackoverflow.com/questions/885908/while-1-vs-for-is-...



Interesting. Looks like they'd be the same performance wise, since

for (;;);

is the same as

{ while (true) { ; ; } }

I originally asked this question cos it's used this way in first C program in the link. Bit of a tangent though :P




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: