The and_eq keyword is an alias, or alternative operator, for the &= operator, which performs an AND and then assigns the value of the AND to the left-hand argument.
Example
and_eq.cpp
C++
<cstdio>int main() { char item1 = 0b1001; char item2 = 0b0111; item1 and_eq item2; // same as item1 &= item2 printf("%#06b\n", item1); return 0;}
Output when executed:
0b0001
See Also
- and
- bitand
- bitor
- not
- not_eq
- or
- or_eq
- xor
- xor_eq