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