comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@shell5.ba.best.com>
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: <Pine.BSF.4.05.9811281727020.10058-100000@shell5.ba.best.com> (raw)
In-Reply-To: m3iug0bbpf.fsf@mheaney.ni.net

On Sat, 28 Nov 1998, Matthew Heaney wrote:
> greg <ref15@columbia.edu> writes:
> ... array sorting question snipped ...
> 
> 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.

The problem statement said nothing about whether the sort modified the
original array or not. Ada doesn't specify whether arrays are passed by 
reference; if you want to do a sort in place and return the same array 
then you'll use access types (pointers if you speak C) and work with 
references to the array. I consider it an excellent feature of Ada that
there is no extra syntax for this, unlike C. 

-- Brian






  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
1998-11-28  0:00   ` Brian Rogoff [this message]
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