Subject: | |
From: | |
Reply To: | |
Date: | Tue, 6 May 1997 15:01:21 -0400 |
Content-Type: | TEXT/PLAIN |
Parts/Attachments: |
|
|
On Tue, 6 May 1997, Alexandre Crozat wrote:
> Learning Ada by onesself in only two months is hard, but I'm getting at it...
> Could someone help me with this one:
>
> Is it possible to initialize a multi-dimensionnal array during its definition?
> For single-dimensional arrays, the answer is yes:
> Init : array (0 .. 3) of Integer := (0 => 1, others => 0)
> but what about a 2d array which I would like to fill with zeros?
>
> Thanks for your help.
>
> Alex
> _______________________________________ ...
> Alexandre Crozat
> 2 adresses -|> 2 reasons to reply! :-)
> [log in to unmask]
> [log in to unmask]
This is how you can initialize a two dimensional array using Others
subtype Count_Type is integer range 0 .. 20;
type Td_Array_Type is array
(Integer range 1..5, Integer range 1..5) of Count_Type;
Td_Array : Td_Array_Type := (Others => (0, Others => 0));
Disclaimer: The views here are mine, not my employers..
_______________________________________________________________________
Scott G. Edgerton Tel (508)858-5085
TMD Battle Management Dept Fax (508)858-1502
|
|
|