Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

Xor swap

void xorSwap(void *x, void *y, int len) { 
if (x != y) {
for(; len-- > 0; x++; y++) {
*(char*)x ^= *(char*)y; 
*(char*)y ^= *(char*)x; 
*(char*)x ^= *(char*)y;
}
} 
}
 
PREVIOUS NEXT
Tagged: #Xor #swap
ADD COMMENT
Topic
Name
2+9 =