home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / fortran / 3197 < prev    next >
Encoding:
Internet Message Format  |  1992-08-26  |  1.4 KB

  1. Path: sparky!uunet!snorkelwacker.mit.edu!ai-lab!life.ai.mit.edu!burley
  2. From: burley@geech.gnu.ai.mit.edu (Craig Burley)
  3. Newsgroups: comp.lang.fortran
  4. Subject: Re: F77, array passing question, dimensions.
  5. Message-ID: <BURLEY.92Aug26123830@geech.gnu.ai.mit.edu>
  6. Date: 26 Aug 92 16:38:30 GMT
  7. References: <1992Aug26.032018.20430@news.clarkson.edu>
  8. Sender: news@ai.mit.edu
  9. Organization: Free Software Foundation 545 Tech Square Cambridge, MA 02139
  10. Lines: 17
  11. In-reply-to: russell@sun.soe.clarkson.edu's message of 26 Aug 92 03:20:18 GMT
  12.  
  13. In article <1992Aug26.032018.20430@news.clarkson.edu> russell@sun.soe.clarkson.edu (David Russell) writes:
  14.  
  15.       Given an array dimensioned to lets say 10 in a calling routine,
  16.    and given the fact that only the first three values are needed in
  17.    the called routine, is there any advantage or disadvantage to
  18.    dimensioning the array to only 3 in the called routine.
  19.  
  20. Generally, no.  Most implementations will just pass the address of the
  21. first element of the array, which is contiguous in memory.  A few
  22. implementations might involve passing the data values themselves; F77
  23. permits this; but they are quite rare.  If you find yourself running
  24. on such an implementation, you could EQUIVALENCE the 10-element array
  25. to a 3-element one and pass the latter.
  26. --
  27.  
  28. James Craig Burley, Software Craftsperson    burley@gnu.ai.mit.edu
  29. Member of the League for Programming Freedom (LPF)
  30.