&= (Bitwise & assignment)
compound assignment &= (Bitwise & assignment)
What changes
- Input
- target value and an expression
- Output or change
- the same variable or column
- Return type
- Returns the data type of the argument with the higher precedence. For more information, see Data type precedence.
Syntax at a glance
expression &= expression
Work example
A flag field needs &= (Bitwise & assignment) to test or change a specific bit mask.
Use small integer values with one bit set at a time. Compare the mask before and after the expression.
Check your work &= (Bitwise & assignment). The result of &= (Bitwise & assignment) changes only the intended bit and keeps unrelated flags intact.
Open Microsoft Learn for full syntax, permissions, and details for your version.