# include & lt; stdio.h>
Void swap (int * x, int * y)
{
* x=((* x) ^ (*) y);
X * y=((*) ^ (*) y);
* x=((* x) ^ (*) y);
}
Int main ()
{
int a,b;
A=2; B=3;
Swap (& amp; A, & amp; B);
Printf (" % d, % d ", a, b);
}
X=2 ^ 3;
Y=8 ^ 3;
X=8 ^ 512;
Therefore, the value exchange?
CodePudding user response:
^ not power function, this is the bitwise xor in c + +, 0, same different 1X=2, y=3
X=2 ^ 3=1
Y=1 ^ 3=2
X=1 ^ 2=3
The end result is exchanged,
CodePudding user response: