次の構造が定義されています。
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}
ポイントは配列であり、ポイントのサイズはさまざまであるため、ポインターである必要があることを理解しています。
後で新しい変数を作成します。
curr_loop_intime = {loop_time_struct}
次に、値を入力します。
FOR POINT=0,n_elements(IND)-1 DO BEGIN
points_arr[POINT].x = X(IND[POINT])
points_arr[POINT].y = Y(IND[POINT])
ENDFOR
次に、次のようにして、ポイント配列をループに割り当てようとします。
*(curr_loop_intime.points)=ptr_new(points_arr)
しかし、この行は私にエラーを与えます:
% Unable to dereference NULL pointer: <POINTER (<NullPointer>)>.
誰か提案はありますか?