Re: Initialisation of multidimensional array



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

.