fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. auto SwapInt = [] (int *x, int *y) {(*x)^=(*y);(*y)^=(*x);(*x)^=(*y); };
  5. int main(){
  6. int a = 1 , b = 2;
  7. cout << a << b << endl;
  8. SwapInt(&a, &b);
  9. cout << a << b << endl;
  10. return 0;
  11. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
12
21