fork download
  1. #include <cstdio>
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int a = 3;
  10. int b = 2;
  11. int *pa = &a;
  12. int *pb = &b;
  13.  
  14. (*pa) ^= (*pb) ^= (*pa) ^= (*pb);
  15.  
  16. cout << *pa << " " << *pb << endl;
  17. cout << a << " " << b << endl;
  18. }
Success #stdin #stdout 0s 2852KB
stdin
Standard input is empty
stdout
2 3
2 3