best algorithm for swapping?
- by ashish yadav
i have heard from a friend of mine that the best algorithm for swapping is
" (a^=b^=a^=b)"
where a and b are two integers to be swapped.
but when i applied this using c language it resulted in crashing.
can anyone of you fine people explain the possible reason for that?
please suggest the best algorithm for swapping.
thank you!!!!