Is there any builtin function in C that returns me the first bit equals to zero in a 32-bit integer?
I know I can check all 32-bit using a for-loop:
value <--- parameter (uint32_t)
for (int i=0; i<32; i++){
uint32_t pos = 1 << i;
if (pos ^ value) return i; // xor
}
return -1;