comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: problem with call_external()
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: problem with call_external() [message #5123 is a reply to message #5109] Fri, 06 October 1995 00:00 Go to previous messageGo to previous message
chs11 is currently offline  chs11
Messages: 14
Registered: October 1995
Junior Member
In article <450kgr$2tq@hermod.uio.no>,
Stein Vidar Hagfors Haugan <steinhh@amon.uio.no> wrote:
> In article <44va4a$khr@apakabar.cc.columbia.edu>, chs11@inibara.cc.columbia.edu (Carl H Sayres) writes:
> |> I'm trying to pass a two dimensional array of floats to an ansi C function.
> |> a = (float **) argv[0]; /* this doesn't work */
>
> A two-dimensional array is still just an array -- no extra level of
> indirection is implied. You're treating a as if it was passed to your
> routine in the form of an array of pointers to each row (or column).
> This is not the case. Only one pointer is passed, and element a(i,j)
> can be found in your C program by the expression *(a + i + j*n).

I'm passing the 2-d array to another function which is expecting a
float **. Can I create a *float[], and fill in the values ?
eg. for an m by n matrix:
float ** list;
list = (float **) malloc(sizeof(float *) * m);
for(i=0;i<m;i++) list[i] = (a + i*m);

will that work?

Carl
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: How many files simultaneously open ?
Next Topic: Re: X-windows black on white

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 12:46:53 PDT 2025

Total time taken to generate the page: 0.48149 seconds