comp.lang.ada
 help / color / mirror / Atom feed
From: Al Christians <alc@PublicPropertySoftware.com>
Subject: Re: How to do it in Ada ?
Date: Sun, 15 Jul 2001 23:41:21 -0700
Date: 2001-07-15T23:41:21-07:00	[thread overview]
Message-ID: <3B528C91.98157C9@PublicPropertySoftware.com> (raw)
In-Reply-To: 9itna2$i5b$1@news.tpi.pl

with Ada.Text_IO;
with Ada.Command_Line;
procedure Initialize_Array is

   A:  Array(1..Integer'Value(Ada.Command_Line.Argument(1))) 
         of Integer := ( Others => 0 );
   begin
      -- The array is already initialized
      -- The following statements just show that it is
      Ada.Text_IO.Put( "First =" & Integer'Image(A'First));
      Ada.Text_IO.Put( "  First Value =" & Integer'Image(A(A'First)));
      Ada.Text_IO.Put( "  Last =" & Integer'Image(A'Last));
      Ada.Text_IO.Put( "  Last Vale=" & Integer'Image(A(A'Last)));
   end;      


Tomasz Wegrzanowski wrote:
> 
> int main(int argc, char **argv)
> {
>     int *x;
>     int n;
> 
>     n = (argc==1)?1:atoi(argv[1]);
>     x = malloc (n*sizeof(int));
>     for (x=0;x<n;x++)
>         x[i]=0;
> 
>     /* ... */
> }
> 
> Something like that ... how to do such dynamic array allocation in Ada ?



  parent reply	other threads:[~2001-07-16  6:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-16  3:33 How to do it in Ada ? Tomasz Wegrzanowski
2001-07-16  5:31 ` Jeffrey Carter
2001-07-16  6:41 ` Al Christians [this message]
2001-07-16  6:51 ` tmoran
2001-07-16 16:56   ` Mark Lundquist
2001-07-16 18:42     ` Nonsense (was Re: How to do it in Ada ?) Mark Lundquist
2001-07-16 22:20       ` Jeffrey Carter
2001-07-17  0:13       ` Ken Garlington
2001-07-17  3:53       ` Robert Dewar
2001-07-16 22:18     ` How to do it in Ada ? Jeffrey Carter
2001-07-17  4:06       ` tmoran
2001-07-20  5:39     ` David Thompson
2001-07-16 17:37   ` Ken Garlington
replies disabled

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