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

Home » Public Forums » archive » Creating an IDL array within C?
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: Creating an IDL array within C? [message #62225 is a reply to message #62172] Sat, 30 August 2008 09:52 Go to previous messageGo to previous message
MC is currently offline  MC
Messages: 50
Registered: September 1996
Member
On Aug 30, 1:40 am, "hotplainr...@gmail.com" <hotplainr...@gmail.com>
wrote:
> Hi guys,
>
> Another problem for everyone. Yay!
>
> Firstly, I'm working on translating code from IDL to C for CUDA
> purposes by re-writing it as a system routine.
>
> so the issue:
>
> Within IDL, the user can do this
>
> IDL> help, data6
> DATA6           UNDEFINED = <Undefined>
>
> and call an arbitrary function that will have it created.
>
> thisfunc, data6, wv
>
> Within thisfunc.pro
> pro thisfunc, data6, wv
>    data6 = fltarr(5,6)
>
> How do I do this in C?
> Is it even possible or do I have to ensure that data6 exists before I
> call my system routine?
>
> Regards
> Zaki

When you create the function prototype you declare the variable, even
if it has no value at that time.
In your case 'data6' could be a pointer variable for an as yet unsized
or variable sized array
-at least that's how I remember ANSI C should work e.g.

<myheader.h>

int thisfunc(float *data6, int wv ....);

Cheers
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: 3D phase diagram drawing
Next Topic: Re: 3D phase diagram drawing

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

Current Time: Fri Oct 10 04:46:00 PDT 2025

Total time taken to generate the page: 1.20155 seconds