fork(1) download
  1. #include <stdio.h>
  2.  
  3. void swap(int x,int*y);
  4.  
  5. int main(void){
  6. int x=3;
  7. int y=5;
  8. swap(x,&y);
  9. printf("x=%d,y=%d\n",x,y);
  10. return 0;
  11. }
  12.  
  13. void swap(int x, int*y){
  14. int temp;
  15. temp=x;
  16. x=*y;
  17. *y=temp;
  18. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
x=3,y=3