int a = 3;
int b = 5;
a = a ^ b;//a = 6
b = a ^ b;//b = 3
a = a ^ b;//a = 5
printf("%d,%d\n", a, b);
void swap2( int *p, int *q, int a, int b ) {
*p = b;
*q = a;
}
int a = 3;
int b = 5;
a = a ^ b;//a = 6
b = a ^ b;//b = 3
a = a ^ b;//a = 5
printf("%d,%d\n", a, b);
void swap2( int *p, int *q, int a, int b ) {
*p = b;
*q = a;
}