, C - 0 false, true. ( , - a<b int)
, , bits-- 0.
When an operator --comes after a variable, it reduces the variable and gets the previous value. for example, if you have int a=3,b; b=a--;, then b will be 3, and there will be 2.
So, the loop will exit after the bit is reduced from 0to -1. This means that if at the beginning bits==8(for example), the cycle will be repeated 8 times, when in the first bits will be equal to 7 (because the condition has been checked), and in the last bits will be equal to 0. A good way to loop through an array (since in c is an array variables bitsindexed from 0to bits-1).
source
share