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

Home » Public Forums » archive » Creating pointer in structure
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Creating pointer in structure [message #27752] Thu, 01 November 2001 06:19
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
If I need to define a structure containing a pointer before I know the
characteristics of the associated heap variable, which of the following
is preferable? Does it make any difference, or is it simply a matter
of programming taste?


For example:

a = {point: PTR_NEW()} ;Create struct w/ null pointer
... figure out what n is
a.point = PTR_NEW(FINDGEN(n)) ;Replace null pointer


or


b = {point: PTR_NEW(/ALLOCATE_HEAP)} ;Create struct w/ pointer->undef
... figure out what n is
*b.point = FINDGEN(n) ;Define heap var


Thanks, Ken
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: texture_coord
Next Topic: Re: gif license

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

Current Time: Wed Oct 08 17:37:20 PDT 2025

Total time taken to generate the page: 0.00431 seconds