comp.lang.ada
 help / color / mirror / Atom feed
From: Ina Drescher <ina.drescher.1985@googlemail.com>
Cc: wolfgang.meyerle@googlemail.com
Subject: Initialization of Arrays in Ada
Date: Wed, 24 Feb 2010 13:11:16 -0800 (PST)
Date: 2010-02-24T13:11:16-08:00	[thread overview]
Message-ID: <d7d8271e-9b42-4c77-ab26-83c56c481606@f8g2000yqn.googlegroups.com> (raw)

Hi Ada Users,

I have a question concerning the initialization of an array in Ada.

For instance I have sth. like this:

arr : Array (Integer Range<>) of Integer:=(1=>1, 2=>2);

I just want to leave out the 1=> 2=> ...

Is there any way like declating undefinite range arrays that ada does
the counting work:

In C in know this would be like this:

char name[]="Test" and the compiler counts the number of characters.

How is this done in Ada ?
I know it's possible to count the number of entries for myself and
then I could eliminate the 1=> ... so that it will look like this:


arr : Array (Integer Range 1..2) of Integer:=(1, 2);







             reply	other threads:[~2010-02-24 21:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-24 21:11 Ina Drescher [this message]
2010-02-24 21:30 ` Initialization of Arrays in Ada Ludovic Brenta
2010-02-24 21:30 ` sjw
2010-02-24 21:52   ` Jeffrey R. Carter
2010-02-24 23:50     ` Randy Brukardt
2010-02-25  0:01     ` Robert A Duff
replies disabled

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