Home »
Public Forums »
archive »
Everything I always wanted to know about IDL * but were afraid to ask. Chapter1
Everything I always wanted to know about IDL * but were afraid to ask. Chapter1 [message #36941] |
Fri, 14 November 2003 04:16 |
Nuno Oliveira
Messages: 75 Registered: October 2003
|
Member |
|
|
1. Pointers.
I do understand the concept of pointers (or I suppose I do) but I'm with
troubles with working with them on IDL. I create a pointer;
A=PTR_NEW(/ALLOCATE_HEAP)
I know how to add values to the pointer;
*A=first_value
*A=[*A, next_value]
As many times as the values I want to add to the pointer.
I can print the whole pointer with PRINT, *A. But how can I get intermediate
positions??.
As far as I can recall from my C classes I do believe that in C, A means the
memory position pointed by A, in what we could call the first pointer
positions and you could use a counter to get further position with a syntax
like *(A+counter) In IDL *A means not only the memory position pointed by A
but also the full contents of the pointer?
Cheers,
Nuno.
I can tell that for my particular I have already a solution that is to
create an array as new=INTARR(N_ELEMENTS(*A)) and then I make new=*A But my
curiosity still remains.
|
|
|
Current Time: Sat Oct 11 03:55:28 PDT 2025
Total time taken to generate the page: 1.51770 seconds