What does | = in C #?
Example:
int a= 0; int b = a |= 5;
I can not find any hints for this.
assignment operator OR.
full explanation here. http://msdn.microsoft.com/en-us/library/h5f1zzaw(v=vs.71).aspx
| = - assignment operator OR.
http://msdn.microsoft.com/en-us/library/h5f1zzaw.aspx
"|" is a bitwise OR operator. http://msdn.microsoft.com/en-us/library/kxszd0kx(v=vs.71).aspx
So,
a |= 5;
coincides with
a = a | 5;
This is in the MSDN library under operators for C #
This is an assignment operator that executes a bitwise logical OR on integral operands and a logical OR on bool operands.
http://msdn.microsoft.com/en-us/library/h5f1zzaw(v=VS.100).aspx
Bitwise or.
Your fragment will be.
int a = 0; int b; a = a | 5; b = a;
In the end, a = b = 5