comp.lang.ada
 help / color / mirror / Atom feed
* Dynamic memory allocation with Ada83
@ 2000-01-24  0:00 vxo25
  2000-01-24  0:00 ` Matthew Heaney
  0 siblings, 1 reply; 2+ messages in thread
From: vxo25 @ 2000-01-24  0:00 UTC (permalink / raw)


Hello,

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

Solutions using ada95 are not accepted because I have only
a Ada83 compiler.

Thanks by advance
VXO



Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Dynamic memory allocation with Ada83
  2000-01-24  0:00 Dynamic memory allocation with Ada83 vxo25
@ 2000-01-24  0:00 ` Matthew Heaney
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Heaney @ 2000-01-24  0:00 UTC (permalink / raw)


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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-01-24  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-24  0:00 Dynamic memory allocation with Ada83 vxo25
2000-01-24  0:00 ` Matthew Heaney

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