comp.lang.ada
 help / color / mirror / Atom feed
* Initialization of Arrays in Ada
@ 2010-02-24 21:11 Ina Drescher
  2010-02-24 21:30 ` Ludovic Brenta
  2010-02-24 21:30 ` sjw
  0 siblings, 2 replies; 6+ messages in thread
From: Ina Drescher @ 2010-02-24 21:11 UTC (permalink / raw)
  Cc: wolfgang.meyerle

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);







^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-02-25  0:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-24 21:11 Initialization of Arrays in Ada Ina Drescher
2010-02-24 21:30 ` 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

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