Home »
Public Forums »
archive »
Creating pointer in structure
Creating pointer in structure [message #27752] |
Thu, 01 November 2001 06:19 |
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
|
|
|
Current Time: Wed Oct 08 17:37:20 PDT 2025
Total time taken to generate the page: 0.00431 seconds