comp.lang.ada
 help / color / mirror / Atom feed
From: "Beard, Frank [Contractor]" <beardf@spawar.navy.mil>
Subject: RE: arrays..
Date: Sun, 12 May 2002 20:30:15 -0400
Date: 2002-05-12T20:30:15-04:00	[thread overview]
Message-ID: <mailman.1021249922.3094.comp.lang.ada@ada.eu.org> (raw)

Arrays of characters are called strings:

   word : string (1..50);   -- anonymous declaration

or

   type Word_Type is string (1..50);
   word : Word_Type;

Of course, nothing stops you from declaring:

   type Word_Type is array (1..50) of character;
   word : Word_Type;

But, there are advantages to using strings, including
predefined packages for doing various things.

As far as arrays of words, you will have to grow
your own.  You could use something like:

   type Word_Array is array (1..100) of Word_Type;

or, a little more dynamic:

   type Word_Array is array (1..100) of
           Ada.Strings.Unbounded.Unbounded_String;

Plus, a hundred other variations.

Frank

-----Original Message-----
From: devine
To: comp.lang.ada@ada.eu.org
Sent: 5/12/02 7:34 PM
Subject: arrays..

Hi.  I have seen many examples of array of integers and floats, are
their
any examples of  array of characters and array of words?


_______________________________________________
comp.lang.ada mailing list
comp.lang.ada@ada.eu.org
http://ada.eu.org/mailman/listinfo/comp.lang.ada



             reply	other threads:[~2002-05-13  0:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-13  0:30 Beard, Frank [Contractor] [this message]
2002-05-13 10:45 ` arrays chris.danx
  -- strict thread matches above, loose matches on Subject: below --
2003-05-29 10:08 Arrays Drey
2003-05-29 12:00 ` Arrays John R. Strohm
2003-05-29 12:22 ` Arrays David C. Hoos, Sr.
2003-05-29 20:36   ` Arrays Drey
2002-05-12 23:34 arrays devine
replies disabled

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