Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ179
Page ↗
Q179FWASIC interview problem

Dynamic-array resizing

TechniquesSystemVerilogContainer operations
DifficultyEasy
TopicData Structures
LanguageSystemVerilog
Format4 choices
01

Problem

What does the display print?

Starting declarationSystemVerilog
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]);
end
02

Answer choices (4)