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

Home » Public Forums » archive » Re: taming the shrew, a.k.a. structure
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: taming the shrew, a.k.a. structure [message #26016 is a reply to message #26001] Wed, 01 August 2001 08:55 Go to previous messageGo to previous message
Todd Clements is currently offline  Todd Clements
Messages: 23
Registered: January 2001
Junior Member
david@dfanning.com (David Fanning) wrote:
>> temp = myStruct.array1
>> myStruct.array1 = ptr_new( (*myStruct.array1)[0:1024] )
>> ptr_free, temp
>
> This really becomes nothing more than this:
>
> *myStruct.array1 = (*myStruct.array1)[0:1024]
>
> There is no need to free the old pointer, make
> a new one etc. Pointers are like IDL variables
> in this respect. They *always* point to the
> current thing you have pointed them too.

That's a useful thing to know. I didn't realize that IDL would do that
for you. I guess coming from the world of C, my default reaction is to
think that pointers are static and you have to make sure to explicitly
resize them appropriately if that's what you want to do. I guess that
works with all variables in C, but I'd gotten used to regular variables
not being static.

Well, guess I can shut my brain off for the day since I've already
learned something new. =)

Todd
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL and Beowolf ?
Next Topic: Re: polar contour plots

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

Current Time: Fri Oct 10 08:25:57 PDT 2025

Total time taken to generate the page: 0.39975 seconds