comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: Beginner's question (array parameters to functions)
Date: 1998/11/28
Date: 1998-11-28T00:00:00+00:00	[thread overview]
Message-ID: <m3iug0bbpf.fsf@mheaney.ni.net> (raw)
In-Reply-To: 365F4360.F7E85C1E@columbia.edu

greg <ref15@columbia.edu> 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.






  parent reply	other threads:[~1998-11-28  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-27  0:00 Beginner's question (array parameters to functions) greg
1998-11-28  0:00 ` Tom Moran
1998-11-28  0:00 ` Matthew Heaney [this message]
1998-11-28  0:00   ` Brian Rogoff
1998-11-29  0:00     ` Matthew Heaney
1998-11-29  0:00   ` Fergus Henderson
1998-11-29  0:00     ` Matthew Heaney
1998-12-02  0:00       ` Fergus Henderson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox