Bitwise And in C and C++

integral-value & integral-value;
& is a bitwise operator; it operates on each individual bit of its two arguments, performing an and operation. For each bit position in the two values, if the bits of both arguments are set to 1, then the result has a bit of 1 in that bit position. Otherwise, it has a value of 0.

For example, if you have binary 0010 and 0110, then bitwise and of the two values returns 0010.


Bitwise operators tutorial

Learn more about bitwise operators and techniques