From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 5 Feb 93 01:58:55 GMT From: emery@mitre-bedford.arpa (David Emery) Subject: Re: question on constant arrays Message-ID: List-Id: The exact Ada analog to the C record is as follows: type strptr is access string; type mytype is record name : strptr; T : integer; end record; type foo_array is array (natural range <>) of strptr; foo : foo_array(1..2) := (new string'("Hi"), 1), new string'("There"),2)); In the C example, the compiler statically allocates space for the two string literals, and returns their address. In the Ada case, you have to explictly allocate storage for the two strings, and use the access value. Remember that in C, all strings are passed by the address of their first element. This is not the way that Ada handles strings. dave p.s. I suspect that you'll be in deep trouble with your C array of struct if you try to use any of the standard C techniques to iterate over the characters in the Name field. Does C guarantee that string literals like "Hi" are null terminated?