fork download
  1. #include<stdio.h>
  2. void swap(int *a,int *b)
  3. {
  4. int t,*tp;
  5. t=*a;
  6. *a=*b;
  7. *b=t;
  8. tp=a;
  9. a=b;
  10. b=tp;
  11. printf("%d,%d",*a,*b);
  12. }
  13. main()
  14. {
  15. int i=3,j=7,*p=&i,*q=&j;
  16. swap(p,q);
  17. printf("%d,%d,%d,%d",i,j,*p,*q);
  18. }
Success #stdin #stdout 0s 4228KB
stdin
Standard input is empty
stdout
3,77,3,7,3