Re: Passing Image Data :) [message #27442 is a reply to message #27327] |
Tue, 23 October 2001 13:04  |
Pavel A. Romashkin
Messages: 531 Registered: November 2000
|
Senior Member |
|
|
Logan Lindquist wrote:
>
> I went back and reviewed how pointers are treated in C++. I was wondering if
> I made my Struct a pointer, could I access memebers of Struct's using the
> '->'?
I wouldn't go so far. IDL makes it simple for you to use pointers, as it
takes care of allocating and deallocating memory when you dereference a
pointer or change its value.
p = ptr_new() ; Make a null pointer (IDL, not C!)
p = ptr_new(fltarr(100)); Place something in it
; or
p = ptr_new(/allocate_heap) ; Same thing but is a valid pointer
*p = fltarr(1000) ; Replace contents.
ptr_free, p ; Make sure nothing stays in memory when done
This is basically all there is. Of course Gurus may have more creative
uses for them :)
-> operator in IDL is used to invoke object methods.
Cheers,
Pavel
|
|
|