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 #14885 is a reply to message #14865] Fri, 02 April 1999 00:00 Go to previous messageGo to previous message
VU KHAC Tri is currently offline  VU KHAC Tri
Messages: 25
Registered: March 1999
Junior Member
>> In C, I can write:
>>
>> void XXX ()
>> {
>> int C = 4;
>> int *pC;
>> pC = &C; /*pC points to C*/
>> }
>>
>> I cannot find out how to do this in IDL ?
>
> IDL> c = 4
> IDL> pC = Ptr_New(/Allocate_Heap)
> IDL> *pC = c
>

I found this :

IDL> c = 4
IDL> pc = PTR_NEW(/ALLOCATE_HEAP)
IDL> *pc = c
IDL> print, *pc
4
IDL> c = 5
IDL> print, *pc
4

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.

Thank you so much for your book.
Best regards,
Tri.
[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: Tue Dec 02 09:01:16 PST 2025

Total time taken to generate the page: 0.24051 seconds