In an example I saw these operators (|= and &=) but it wasn’t explained.
I was looking on Google about it, but I found only results related to the “classic” = operator.
So I would like to know what are these operators doing. Can somebody explain it to me ?
In an example I saw these operators (|= and &=) but it wasn’t explained.
Share
They are simply shorthand assignments like
+=. The following are equivalent:And these are also equivalent.
For more information on those operators, you can see the MSDN Docs on
|and&Operator.