Re: allocatable array *not* equivalent to dynamic allocation?
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Sun, 28 May 2006 12:43:57 -0700
Lo <temporal@xxxxxxxxxxxxxxxxx> wrote:
In a book, I've read the following statement, which I would be grateful
if you could help me understand:
"The Fortran implementation of an allocatable array isn't completely
equivalent to dynamic allocation because it's not possible to use any
element in such a structure until its maximum size has been allocated.
That is, it's not possible to use allocatable arrays to build an
expandable data storage sytructure 'on the fly' ..."
I can't make sense of this. help!
Giles and Brooks have given good answers. I'm curious what book this is,
but allow me to note that it seems to be hung up on what I presume to be
some definition of the author's own making.
Allocatable arrays in fact *ARE* a form of dynamic allocation, much less
being equivalent to one. Dynamic allocation refers to allocation done
dynamically - that is during execution - as opposed to statically during
compilation/loading. At least, that is the usual definition. Allocatable
arrays do that, as do automatic arrays and pointer arrays. The authors
appear to have some other definition of their own; at least that's what
I infer from the citation. I can't quite guess their definition from the
citation, although Giles might have the right guess.
--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.
- Follow-Ups:
- References:
- Prev by Date: Re: allocatable array *not* equivalent to dynamic allocation?
- Next by Date: Re: allocatable array *not* equivalent to dynamic allocation?
- Previous by thread: Re: allocatable array *not* equivalent to dynamic allocation?
- Next by thread: Re: allocatable array *not* equivalent to dynamic allocation?
- Index(es):
Relevant Pages
|