Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
praptak
· 7mo ago · 0 comments
Xor swap trick has perfect profile for underhanded C contests. It generally works until a specific condition triggers its failure. The condition is "the arguments are aliases", so for example XOR_SWAP(a[i], a[j]) when i=j.
Comments
[–]
imploded_sub
7mo ago
TFA mentions this as an issue for the trick, whereas you rightly point out it's an evil feature instead.