Re: Initialisation of multidimensional array
- From: glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx>
- Date: Thu, 13 Jul 2006 10:42:21 -0700
Ugo wrote:
David Flower wrote:
Is there an elegant way of doing the following.
If have an array:
INTEGER :: ANSWER(10,10,10) = ?????
Where ????? sets every element of the array to 42
Yes, sure. Put 42 in place of ?????, and you have a compile time
initialization.
Note that this might require 1000 copies of the number 42 to appear
in the object file, and possibly to be read from disk when the program
is loaded. It is an implementation detail, but that is a common
implementation. 1000 isn't so bad, but 1000000 might be.
-- glen
.
- Follow-Ups:
- Re: Initialisation of multidimensional array
- From: Richard E Maine
- Re: Initialisation of multidimensional array
- References:
- Initialisation of multidimensional array
- From: David Flower
- Re: Initialisation of multidimensional array
- From: Ugo
- Initialisation of multidimensional array
- Prev by Date: Re: optional arguments in subroutine or using generic procedure
- Next by Date: Re: Initialisation of multidimensional array
- Previous by thread: Re: Initialisation of multidimensional array
- Next by thread: Re: Initialisation of multidimensional array
- Index(es):