|=

Can anybody tell me what "|=" does? can you gimme an example?

Any help would be appreciated.
Sina
It's a compound assignment with a bitwise or. This:

x = x | y;

is equivalent to:

x |= y;
a |= b
means
a = a | b
| is binary or. You can think of it as || done for every pair of bits of a and b (0100 | 1001 = 1101)
Thanks guys
Topic archived. No new replies allowed.