c - Use of the while loop -


this question has answer here:

i saw in lots of example form of use while loop i'm not sure it's ok use in code.

 while(1){      // code lines      if(condition){         break;     }      // code lines } 

is ok use? does

while(1)   

exactly mean?

is ok use? exactly

yes, , commonly used in programming.

while(1) same while(true), condition thats true, ensuring while loop never stops until manually break out of break;

there many applications behavior. exit condition complex, requires function calls, etc. want infinite loop program (for menu instance) exits on specific prompts. wether or not use often stylistic choice.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -