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