Re: dereferencing a pointer to a complex structure? [message #43409] |
Mon, 11 April 2005 17:55  |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
On Mon, 11 Apr 2005 08:14:18 -0700, zuzucat@gmail.com wrote:
> I have a troulbe dereferencing a pointer to a complex structure.
>
> multidata = replicate({ grds:ptr_new(findgen(nx, ny))}, n_level) data =
> replicate({time:0, level:multidata}, obs) I
> DL> print, (*data[3].level[3].grds)[0,4]
> 4.00000
>
> ptr_data = ptr_new(data)
>
> I tried (*(*data[3].level[3].grds))[0,4], but it doesn't work.
>
> Any help would be appreciated.
> best,
You need the operator precedence tutorial:
http://www.dfanning.com/misc_tips/precedence.html
JD
|
|
|
Re: dereferencing a pointer to a complex structure? [message #43493 is a reply to message #43409] |
Tue, 12 April 2005 12:11  |
zuzucat@gmail.com
Messages: 4 Registered: April 2005
|
Junior Member |
|
|
I've read this page, but I couldn't apply the info to this particular
example.
NM
JD Smith wrote:
> On Mon, 11 Apr 2005 08:14:18 -0700, zuzucat@gmail.com wrote:
>
>> I have a troulbe dereferencing a pointer to a complex structure.
>>
>> multidata = replicate({ grds:ptr_new(findgen(nx, ny))}, n_level)
data =
>> replicate({time:0, level:multidata}, obs) I
>> DL> print, (*data[3].level[3].grds)[0,4]
>> 4.00000
>>
>> ptr_data = ptr_new(data)
>>
>> I tried (*(*data[3].level[3].grds))[0,4], but it doesn't work.
>>
>> Any help would be appreciated.
>> best,
>
> You need the operator precedence tutorial:
>
> http://www.dfanning.com/misc_tips/precedence.html
>
> JD
|
|
|