Hardware interview practice
Dynamic-array resizing
What does the display print?
Starting point
Question code
int da[];
initial begin
da = new[3];
da = '{1, 2, 3};
da = new[5](da);
$display("%0d %0d %0d", da.size(), da[2], da[4]);
endChoose one
Answer choices
- A. 5 3 0
- B. 5 0 0
- C. 3 3 0
- D. 5 3 x
