Bitwise OR Assignment Operator (|=)

By: Dusty Arlia
Published on March 8, 2013
Last Updated on Sunday, July 05, 2015 at 6:35 PM
Total Updates: 3

The bitwise OR assignment operator (|=) Performs a bitwise OR on the value of a variable and the value of an expression and assigns the result to the variable. Here is the basic syntax:

a |= b //performs bitwise OR on a and b and assigns results to a

a = a | b //equivalent to this