Advertisement
Guest User

Untitled

a guest
Jan 9th, 2017
755
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. double *function(double a[2], double b[2])
  6. {
  7. static double result[2];
  8.  
  9. result[0] = a[0]-b[0];
  10. result[1] = a[1]+b[1];
  11.  
  12. return result;
  13. }
  14. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  15. int main()
  16. {
  17. double y[2];
  18. double *x = &y;
  19. double z[2];
  20. double *w = &z;
  21.  
  22. z[0] = 3;
  23. z[1] = 2;
  24.  
  25. x = function(z,z);
  26. w = function(x,z);
  27.  
  28. printf("\n (%lf ; %lf)",x[0],x[1]);
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement