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: 109fba,955187ea690ddfda X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,955187ea690ddfda X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-25 10:54:47 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada,comp.lang.c++ Subject: Re: Interfacing Ada95 to C++ - Object passing problem Date: 25 Apr 2002 13:50:50 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <6c12025b.0204250344.5944d770@posting.google.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1019757424 27520 128.183.220.71 (25 Apr 2002 17:57:04 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 25 Apr 2002 17:57:04 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:23114 comp.lang.c++:141776 Date: 2002-04-25T17:57:04+00:00 List-Id: markus.knauss@gmx.net (Markus Knauss) writes: > The body and spec of the Ada implementation defines a class with a > single attribute. The attribute is an unbounded_string. The attribute > of an object of this class can be set with the "set" method. Below > excerpts from the spec and body file: > > The C value "Hello World" is _not_ of the Ada type String. String is an Ada unconstrained array; it has bounds with it. If you want to pass a C string to Ada code, you need to use the package Interfaces.C.Strings, or make some compiler-dependent guesses about how Ada strings are actually stored. I suggest you start with very simple C code and very simple Ada code, and figure out how to pass strings back and forth. then add the Unbounded strings and stuff. -- -- Stephe