fork download
  1. #include <stdio.h>
  2.  
  3. void swap(int *a, int *b, int c, int d){
  4.  
  5. int temp;
  6.  
  7. temp = *a;
  8.  
  9. *a = *b;
  10.  
  11. *b = temp;
  12.  
  13. temp = c;
  14.  
  15. c = d;
  16.  
  17. d = temp;
  18.  
  19. }
  20.  
  21.  
  22.  
  23. int main(void){
  24.  
  25. int w=10,x=20,y=30,z=40;
  26.  
  27. swap(&w, &x, y, z);
  28.  
  29. printf("%d %d %d %d\n", w, x, y, z);
  30.  
  31. return 0;
  32.  
  33. }
Success #stdin #stdout 0s 4544KB
stdin
Standard input is empty
stdout
20 10 30 40