You can't do it with every data type, unless you write in assembler and directly access registers. High-level language virtually all say this is undefined behaviour. You can't treat pointers, or any other type as an unsigned 2's complement integer -- the type where this xor'ing works. It's either unspecified, or even undefined behaviour.
You can't do it with every data type, unless you write in assembler and directly access registers. High-level language virtually all say this is undefined behaviour. You can't treat pointers, or any other type as an unsigned 2's complement integer -- the type where this xor'ing works. It's either unspecified, or even undefined behaviour.
That's fair. My personal experience is a bit limited so it's always good reading articles like this.