S
Saxena
Hi what are the usage scenerio of |= OR Assignment Operator
Hi what are the usage scenerio of |= OR Assignment Operator
Hi what are the usage scenerio of |= OR Assignment Operator
Joe said:a = a | b;
Forgive my ignorance, but what does this mean? I can see that it's
assigning some value to "a" based upon the outcome of the RHS, but what
does the RHS actually do? Could you give some examples, and possibly a
scenario where this would be used?
Jeff said:It operates on the values at the bit level. …
* The rules are: 0 | 0 yields 0, any other combination yields 1, meaning if
either bit or both are 1, the result is 1.
Dylan said:Forgive my ignorance, but what does this mean? I can see that it’s
assigning some value to “a†based upon the outcome of the RHS, but what
does the RHS actually do? Could you give some examples, and possibly a
scenario where this would be used?