best algorithm for swapping?

Posted by ashish yadav on Stack Overflow See other posts from Stack Overflow or by ashish yadav
Published on 2010-03-13T05:22:55Z Indexed on 2010/03/13 5:25 UTC
Read the original article Hit count: 291

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about c

    Related posts about swap