What for (;;) and while(); mean in C [duplicate]
问题 This question already has answers here : What does “for(;;)” mean? (5 answers) Closed last year . I am looking at some example codes and I saw someone did this for (;;) { // ... } Is that equivalent to while(1) { } ? And what does while(condition); do? I don't get the reason behind putting ';' instead of {} 回答1: yes, for(;;){} is an infinite loop 回答2: And what does while(condition); do? I don't get the reason behind putting ';' instead of {} Well, your question is what happens if you put or