fork download
  1. #include <stdio.h>
  2.  
  3. void swap(int *x,int *y);
  4.  
  5. int main(void) {
  6. int data1[5]={1,2,3,4,5};
  7. int data2[5]={6,7,8,9,10};
  8. swap(data1,data2);
  9.  
  10. for(int i=0;i<5;i++){
  11. printf("%d",data1[i]);
  12. printf("%d\n",data2[i]);
  13. }
  14. return 0;
  15. }
  16. void swap(int *x,int *y){
  17. int *w;
  18. for(int i=0;i<5;i++){
  19. *w=x[i];
  20. x[i]=y[i];
  21. y[i]=*w;
  22. }
  23. }
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
61
72
83
94
105