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

Home » Public Forums » archive » Re: Help: Pointer
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: Help: Pointer [message #14865] Sat, 03 April 1999 00:00 Go to previous message
steinhh is currently offline  steinhh
Messages: 260
Registered: June 1994
Senior Member
Vu Khac Tri wrote:

> But in C, when c is modified, (*pc) is also modified because
> pc points to the memory where c is. That mean, if c = 5, *pc = 5.

You're right. IDL doesn't have pointers in the same sense
as C does - there is no "address of" operator, and there
is no way to make a pointer that points to a normal variable.

The closest thing (and it's close enough to emulate
the C behaviour, but not it's notation) is:

IDL> c=ptr_new(4)
IDL> pc=c
IDL> print,*pc
4
IDL> *c = 5
IDL> print,*pc
5

I.e., you have two pointers, pointing to the same heap
variable. The only difference from C notation is that
you have to dereference *both* variables as pointers.

Regards,

Stein Vidar
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: "ALOG2" ? (Ugly code follows)
Next Topic: "ALOG2" ?

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

Current Time: Wed Oct 15 08:04:55 PDT 2025

Total time taken to generate the page: 0.08013 seconds