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 0.01s 5292KB
stdin
Standard input is empty
stdout
x=5,y=3