comp.lang.ada
 help / color / mirror / Atom feed
From: "DuckE" <nospam_steved94@home.com>
Subject: Re: Interface to C; Storage_Error
Date: Sat, 23 Dec 2000 02:45:43 GMT
Date: 2000-12-23T02:45:43+00:00	[thread overview]
Message-ID: <rlU06.183972$U46.5726827@news1.sttls1.wa.home.com> (raw)
In-Reply-To: 91sq4j$tpr$1@nnrp1.deja.com


>
> > Since the "C" prototype is using "char *" I suspect you need
> > to allocate the data to send to the function.
>
> I see no reason for this suspicion, either on the basis of how
> any compiler I know about works, or from the RM, please tell us
> where you got this idea from :-)
>

In the original post the "C" prototype for the function GetNextVal is:

   int GetNextVal(SRV_HANDLE srv, RSLT_HANDLE rslt, CTX_HANDLE *ctx,
                  char* name, double* dbl, FLT_HANDLE flt);


If I were calling this function inside a C program it would look something
like:

  char name[255];

  dummy = GetNextVal( ..., name , ... );

In this example "name" is allocated by the caller, and the address of that
memory is passed to the function.  I would not expect the called function to
allocate space for "name".  Perhaps you didn't understand what I was
attempting to say the first time?

SteveD






      reply	other threads:[~2000-12-23  2:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-19 22:28 Interface to C; Storage_Error Chris
2000-12-20  3:52 ` Ted Dennison
2000-12-20  8:55   ` Robert Dewar
2000-12-20 11:39 ` Thomas Wolf
2000-12-20 17:05   ` Chris
2000-12-20 23:57     ` Chris
2000-12-21 15:35       ` Thomas Wolf
2000-12-21 18:07         ` Chris
2000-12-21  3:25 ` DuckE
2000-12-21 11:38   ` Robert Dewar
2000-12-23  2:45     ` DuckE [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox