Possible Duplicate:
What is the fastest way to swap values in C?
I need to exchange values of two integers (for example x and y) This is the simplest way:
int temp = x;
x = y;
y = temp;
and I also found a better way:
x = x + y;
y = x - y;
x = x - y;
Is there a better way to increase performance?