I have the following structures defined:
point_str={loop_point, x:0d, y:0d}
loop_time_str={loop_time_struct, points:ptr_new(/allocate_heap), loop_id:0d, time:0d}
loop_str={loop_struct,time_series:replicate(loop_time_str, num_images), loop_id:0d}
Points is an array and because the size of points varies I understand it needs to be a pointer.
Later on I create a new variable:
curr_loop_intime = {loop_time_struct}
I then populate the values.
FOR POINT=0,n_elements(IND)-1 DO BEGIN
points_arr[POINT].x = X(IND[POINT])
points_arr[POINT].y = Y(IND[POINT])
ENDFOR
I then try to assign the points array to the loop by doing:
*(curr_loop_intime.points)=ptr_new(points_arr)
But this line gives me the error:
% Unable to dereference NULL pointer: <POINTER (<NullPointer>)>.
Does anyone have any suggestions?