Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

n00b question: What is the ^= operator, and what language is it from?


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...


x ^= y is the same as x = x ^ y, with ^ being XOR. Bunch of languages have it, e.g. C, C++, Java, ...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: