fork(2) download
  1. #include <stdio.h>
  2.  
  3. typedef struct {
  4. float x;
  5. float y;
  6. } point;
  7.  
  8. point permute(point M)
  9. {
  10. point N;
  11. N.x = M.y;
  12. N.y = M.x;
  13. return N;
  14. }
  15.  
  16. int main(void)
  17. {
  18. point A;
  19. point B;
  20. int point = 7;
  21.  
  22. A.x = 0;
  23. A.y = 1;
  24. B = permute(A);
  25.  
  26. printf("A (%.2f, %.2f)\n", A.x, A.y);
  27. printf("B (%.2f, %.2f)\n", B.x, B.y);
  28. printf("point = %d\n", point);
  29.  
  30. return 0;
  31. }
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
A (0.00, 1.00)
B (1.00, 0.00)
point = 7