How to initial the dynamic array with struct

Here is my code. But always failed with syntax error. Please help me to correct my code. Thank you



typedef struct {
  int  mode;
  int  pair_num;
} my_cal_s;

my_cal_s my_cal_arr[];
.....
my_cal_arr = new[4];
my_cal_arr = '{'{0,2}, '{1,4}, '{0,3}, '{2, 8}};


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

In reply to dave_59:

I guess something messed-up during my build. I tried again with removing all output files. NOw it passed also on my end. Thank you.