0

Hello,everybody.Would you please describe me about the differences between the(|=) ,(^= )
operators?Is it possible to use(&=)instead of the above two assignments and how?

Thanks,

Assignment,compound operators;[ |=,^= and &=]
2
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by bobyx
0

http://en.wikipedia.org/wiki/Bitwise_operation

The above page describes in detail what each type of operator does. Before I get any criticism, I know it's a wikipedia link and I have already checked it for accuracy.

& = Bitwise AND
| = Bitwise OR
^ = Bitwise XOR (eXclusive OR)
! = Logical NOT
~ = Bitwise NOT

All 5 of the above operators are explained. Also know that learning any or all of these is a lot easier if you understand binary numbers and how to convert from decimal to binary.

NOTE: The operator != shouldn't be confused with &= or ^= and etc. != is a "comparison" and the others are "assignments"

= is used for assignment. (so are += *= |=)
== is used for comparison. (so are >= < %=)

Edited by Bluefox815: Clarification.

0

Thanks from Bluefox815 for your answer and good web referrence;Wikipedia.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.