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,35ae3d13e899b684 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-21 14:48:28 PST Newsgroups: comp.lang.ada Path: supernews.google.com!sn-xit-03!supernews.com!hermes.visi.com!news-out.visi.com!skynet.be!news.tele.dk!134.222.94.5!npeer.kpnqwest.net!uunet!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: Need help mapping a C struct to Ada X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=us-ascii Message-ID: <3AB9295B.DAE4F638@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en References: Mime-Version: 1.0 Date: Wed, 21 Mar 2001 22:21:15 GMT X-Mailer: Mozilla 4.5 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: supernews.google.com comp.lang.ada:5981 Date: 2001-03-21T22:21:15+00:00 List-Id: "(null)" wrote: > > I'm trying to call some C functions from my Ada program. The C function > prototype and data types are basically > > typedef struct { > some fields... > } element; > > typedef struct { > int num_elements; > element the_elements[0]; My C isn't very good, but isn't this the same as element* the_elements; since you have to "manually allocate the memory"? If so, then you should probably use an access type with convention C in Ada.