From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,998965b11075593f X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Beginner's question (array parameters to functions) Date: 1998/11/28 Message-ID: #1/1 X-Deja-AN: 416420860 Sender: matt@mheaney.ni.net References: <365F4360.F7E85C1E@columbia.edu> NNTP-Posting-Date: Fri, 27 Nov 1998 21:57:51 PDT Newsgroups: comp.lang.ada Date: 1998-11-28T00:00:00+00:00 List-Id: greg writes: > My question is the following: As I understand it, in an Ada function, a > parameter must be passed in "in" mode. Therefore, I assume that in this > assignment, the sorting function has to make a copy of the array > parameter, sort the items in this second array, and finally return this > second array to the caller subprogram, because, given that the array is > passed as a parameter, there is no way to change the values of the array > that is copied in for use in the function. > > Is my understanding correct, or is there some way to avoid having to use > two arrays? But there are two arrays no matter what: one is unsorted, and one is sorted. Having two arrays is a condition of the problem statement, and has nothing to do with the language.