How to initial the dynamic array with struct

In reply to zz8318:

It would really help to show a complete small example and the error message you are getting.

This code works for me

module  top ;
  typedef struct {
    int  mode;
    int  pair_num;
  } my_cal_s;
  my_cal_s my_cal_arr[];
  initial begin 
    my_cal_arr = '{'{0,2}, '{1,4}, '{0,3}, '{2, 8}};
  end
endmodule