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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6c08e49fe17c9eeb X-Google-Attributes: gid103376,public From: David Shochat Subject: Re: Help - Call C function (with out parameter) from ADA95 Date: 1996/10/11 Message-ID: <325EE2C6.1D90@itg-sepg.logicon.com>#1/1 X-Deja-AN: 188849279 references: <01bbb779$7d989ca0$0e39e382@caeepc1.cri.dk> content-type: text/plain; charset=us-ascii organization: Logicon Information Technology Group mime-version: 1.0 reply-to: shochat@itg-sepg.logicon.com newsgroups: comp.lang.ada x-mailer: Mozilla 3.0 (Win95; U) Date: 1996-10-11T00:00:00+00:00 List-Id: Mikael Espersen wrote: > > Hi, > > Does anyone know how to call a C function with out a parameter from ADA95. > As far as I know ADA is only allowing in parameters to functions. The C > function also has a return value so I can't declare as a procedure. Any > help would be appreciated Thanks in advance. > > Eks. (C program code) > > int InitArray(char* arr); Seems to me that would just be: function InitArray (Arr : in Interfaces.C.Strings.chars_ptr) return Interfaces.C.int; C doesn't have "out" parameters. In C everything is passed by value. One gets the effect of call by reference by explicitly passing a pointer (by value). Your InitArray() looks kind of dangerous since it doesn't have a parameter to limit the number of characters it writes. -- David