Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
1MachineElf
· 5y ago · 0 comments
n00b question: What is the ^= operator, and what language is it from?
Comments
[–]
valvar
5y ago
It's bitwise XOR in C (and most other languages, I guess).
https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B#Bit...
[–]
detaro
5y ago
x ^= y is the same as x = x ^ y, with ^ being XOR. Bunch of languages have it, e.g. C, C++, Java, ...