fork download
  1. #include <stdio.h>
  2. void swap(int *x, int *y){
  3. int tmp = *y;
  4. *y = *x;
  5. *x = tmp;
  6. }
  7. int main() {
  8. int x = 100;
  9. int y = 200;
  10. swap(&x, &y);
  11. printf("x=%d, y=%d\n", x, y);
  12. return 0;
  13. }
Success #stdin #stdout 0s 5280KB
stdin
stdout
x=200, y=100