Can someone explain what the |= operator does or link me to a page with a description?
Thanks!
Printable View
Can someone explain what the |= operator does or link me to a page with a description?
Thanks!
Well you know that += and -= are of the form:
x += y;
x = x + y;
Same deal:
x |= y;
x = x | y;
The | operator is the bitwise or:
0 | 0 = 0;
1 | 0 = 1;
0 | 1 = 1;
1 | 1 = 1;
0101 | 0111 = 0111;
0100 | 1100 = 1100;
Etc... There are many tutorials on bitwise operators.
Ahh, gotcha.
Thanks