From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,aeab6b16387b2612 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-15 23:37:39 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: Al Christians Newsgroups: comp.lang.ada Subject: Re: How to do it in Ada ? Date: Sun, 15 Jul 2001 23:41:21 -0700 Organization: Public Property Software Message-ID: <3B528C91.98157C9@PublicPropertySoftware.com> X-Mailer: Mozilla 4.76 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 References: <9itna2$i5b$1@news.tpi.pl> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:9984 Date: 2001-07-15T23:41:21-07:00 List-Id: 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 x[i]=0; > > /* ... */ > } > > Something like that ... how to do such dynamic array allocation in Ada ?