#define SWAP(a, b) ((&(a) == &(b)) || \
(((a) -= (b)), ((b) += (a)), ((a) = (b) - (a))))
|
LET'S TALK TECHNICAL
This blog is intended to help people prepare for the job interviews and improve their analytical skills. We have posted difficult datastructures and algorithm questions and puzzles. Interview experiences section is for the people to post their interview experiences.Views expressed here are of their personal and the blog author doesn't take any responsibility for the same.
|
Categories
FollowersBlog Archive
Jobs
Find more freelance jobs
|
Friday, January 18, 2008Swap 2 values with subtraction and addition?#define SWAP(a, b) ((&(a) == &(b)) || \ (((a) -= (b)), ((b) += (a)), ((a) = (b) - (a))))
Subscribe to:
Post Comments (Atom)
|
Popular Posts
|
No comments:
Post a Comment