fork download
  1. #include <stdio.h>
  2.  
  3. void swap(float * x, float * y)
  4. {
  5. float aux;
  6. aux = *x;
  7. *x = *y;
  8. *y = aux;
  9. }
  10.  
  11. int main(void)
  12. {
  13. double a = 3.5, b = 5.6;
  14. long long int *lla = &a, *llb = &b;
  15. printf("%llx %llx\n", *lla, *llb);
  16. swap(&a, &b);
  17. printf("%g %g\n", a, b);
  18. printf("%llx %llx\n", *lla, *llb);
  19. return 0;
  20. }
Success #stdin #stdout 0s 2112KB
stdin
Standard input is empty
stdout
400c000000000000 4016666666666666
3.5 5.6
400c000066666666 4016666600000000