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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,1f8050edb14e8329 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!n38g2000yqf.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: Interfacing to C Date: Sun, 27 Dec 2009 23:20:40 -0800 (PST) Organization: http://groups.google.com Message-ID: <73bc7b9b-e049-4e7e-a501-b33e1c310bdd@n38g2000yqf.googlegroups.com> References: <56284e56-6ac5-427c-8e4f-8a0750527088@z41g2000yqz.googlegroups.com> <4b335ff9$0$6287$4f793bc4@news.tdc.fi> NNTP-Posting-Host: 86.66.190.134 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1261984840 11870 127.0.0.1 (28 Dec 2009 07:20:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 28 Dec 2009 07:20:40 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: n38g2000yqf.googlegroups.com; posting-host=86.66.190.134; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8542 Date: 2009-12-27T23:20:40-08:00 List-Id: On 24 d=E9c, 13:34, Niklas Holsti wrote: > RasikaSriniva...@gmail.com wrote: > > I am building an interface to a C library. This library uses structs > > like the following: > > > typedef struct { > > =A0 =A0 x : int ; > > =A0 =A0 y : int } =A0MyStruct .... > > > While passing variables of this type to functions, the convention in C > > is to pass by value (best of my knowledge). > > Correct, as I understand the C parameter-passing rules. Shame on me, you are both right. I was confused between standard practice and language standard. Language which allow C interface, like some Pascal dialects, do it using implicit by reference structs, while with C, by reference structs is done explicitly using a point type.