Does the statement return a single bit or concatenation of bits.
if(mask[i] & groupbit) {
//...
}
with:
i
= an integermask[i]
= an element of integer pointergroupbit
= An integer
Does the statement return a single bit or concatenation of bits.
if(mask[i] & groupbit) {
//...
}
with:
i
= an integermask[i]
= an element of integer pointergroupbit
= An integerIt will result in an entire integer. When you use the bitwise and, each bit of the two values are and'ed together, and each bit in the result is set accordingly. The result will be the same number of bits as the values being and'ed together.
This is assuming you're using two integer variables.
Assuming mask
is a pointer to an integer type the compiler will do the following:
i
-th element of the mask
"array" as an integerAND
AND
operation the value will be treated as true
, otherwise as false
(if every single bit of the result is 0
)