Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Question about |= in c#

Tags:

c#

c#-4.0

What means |= in c#?

Example:

int a= 0;
int b = a |= 5;

I can't find any hints for this.

like image 216
GrzesiekO Avatar asked Nov 28 '22 18:11

GrzesiekO


2 Answers

the OR assignment operator.

full explanation is here. http://msdn.microsoft.com/en-us/library/h5f1zzaw(v=vs.71).aspx

like image 83
Luis Valencia Avatar answered Dec 20 '22 04:12

Luis Valencia


|= is the OR assignment operator.

http://msdn.microsoft.com/en-us/library/h5f1zzaw.aspx

like image 33
Daniel Walker Avatar answered Dec 20 '22 05:12

Daniel Walker