c - For loop flow with a variable name as a condition. -


what following loop do? when program break out of loop?

for (c = 0; n; c++) {   /* . . . */ } 

here example of such loop in answer on so.

the loop break when n becomes 0 (in other words, loop not stop until n becomes 0). can happen within loop (the loop body sets n 0 eventually), or possibly happen because of external event. examples of external events shared memory update, or modification signal handler. c variable incremented many times loop body entered for loop. c variable initialized 0.

technically, code fragment not for loop, controlling construct of for loop statement. fragment missing loop body. that's okay, since question title "this for-loop structure". question title , post has since been modified.

you link function in different answer, seem understand purpose of function count number of set bits in number.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -