comp.lang.ada
 help / color / mirror / Atom feed
From: "Matthew Heaney" <matthew_heaney@acm.org>
Subject: Re: Dynamic memory allocation with Ada83
Date: 2000/01/24
Date: 2000-01-24T00:00:00+00:00	[thread overview]
Message-ID: <ha4j4.4498$bp2.204159@newsread2.prod.itd.earthlink.net> (raw)
In-Reply-To: 86hpt2$gjj$1@nnrp1.deja.com

In article <86hpt2$gjj$1@nnrp1.deja.com> , vxo25@my-deja.com  wrote:

> Hello,
>
> I want to implement dynamic memory allocation with Ada83.
> Could anyone help me ?

What exactly do you mean by "I want to implement dynamic memory
allocation"?

Do you mean that you want to allocate an object on the heap?  If so,
then do this:

  type TA is access Constrained_Type;

  O : TA := new Constrained_Type;

If you want to allocate an object on the heap whose type is
unconstrained, then you have to supply a constraint:

  type String_Access is access String;

  S : SA := new String'("this is a string on the heap");

or

  S : SA := new String (1 .. 10);


If you don't mean "allocate an object on the heap," then you have to say
what it is you're trying to do.

--
The new standards [for science curricula in Kansas] do not forbid the
teaching of evolution, but the subject will no longer be included in
statewide tests for evaluating students--a virtual guarantee, given the
realities of education, that this central concept of biology will be
diluted or eliminated, thus reducing courses to something like chemistry
without the periodic table, or American history without Lincoln.

Stephen Jay Gould, Time, 23 Aug 1999




      reply	other threads:[~2000-01-24  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-24  0:00 Dynamic memory allocation with Ada83 vxo25
2000-01-24  0:00 ` Matthew Heaney [this message]
replies disabled

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