# Value Assignment Dynamic Array without new()

**URL:** <https://verificationacademy.com/forums/t/value-assignment-dynamic-array-without-new/41006>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, Dynamic-Array, new\
**Created:** [November 15, 2022, 5:37am UTC](https://verificationacademy.com/forums/t/value-assignment-dynamic-array-without-new/41006 "2022-11-15T05:37:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kj](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/kj/32/1709_2.png) [@Kj](https://verificationacademy.com/forums/u/Kj)\
**Post date:** [November 15, 2022, 5:37am UTC](https://verificationacademy.com/forums/t/value-assignment-dynamic-array-without-new/41006/1 "2022-11-15T05:37:25Z")

</div>

```verilog

module top;
  integer da4[];
  initial begin
    da4='{1,2,3,4};
    $display("da4=%p",da4);
  end
endmodule

```

Result: da4='{1,2,3,4};

Doubt: Can we assign value in Dynamic array without using new();

---

<div class="post-metadata">

**Author:** ![cgales](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/c/ccd318/32.png) [@cgales](https://verificationacademy.com/forums/u/cgales)\
**Post date:** [November 15, 2022, 1:48pm UTC](https://verificationacademy.com/forums/t/value-assignment-dynamic-array-without-new/41006/2 "2022-11-15T13:48:27Z")

</div>

_In reply to [Kj@2199](https://verificationacademy.com/forums/t/value-assignment-dynamic-array-without-new/41006):_

Please use [code tags](https://verificationacademy.com/forums/announcements/please-format-your-code-code-and/code-tags) making your code easier to read. I have added them for you.

From the LRM section 7.5 Dynamic arrays:

The size of a dynamic array is set by the new constructor or array assignment, described in 7.5.1 and 7.6 respectively.

So the answer to your question is yes, you can assign a value to a dynamic array without using new().

---

<div class="post-metadata">

**Author:** ![Kj](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/kj/32/1709_2.png) [@Kj](https://verificationacademy.com/forums/u/Kj)\
**Post date:** [January 20, 2023, 6:59am UTC](https://verificationacademy.com/forums/t/value-assignment-dynamic-array-without-new/41006/3 "2023-01-20T06:59:07Z")

</div>

_In reply to [cgales](https://verificationacademy.com/forums/t/value-assignment-dynamic-array-without-new/41006/2):_

Thank you for the clarification.
