# Reading file into dynamic array failed

**URL:** <https://verificationacademy.com/forums/t/reading-file-into-dynamic-array-failed/29656>\
**Category:** SystemVerilog\
**Tags:** dynamic-arrays, SystemVerilog, reading-from-file\
**Created:** [July 1, 2014, 7:11am UTC](https://verificationacademy.com/forums/t/reading-file-into-dynamic-array-failed/29656 "2014-07-01T07:11:27Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![trogers](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@trogers](https://verificationacademy.com/forums/u/trogers)\
**Post date:** [July 2, 2014, 5:30am UTC](https://verificationacademy.com/forums/t/reading-file-into-dynamic-array-failed/29656/3 "2014-07-02T05:30:59Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/reading-file-into-dynamic-array-failed/29656/2):_

that could the answer, but “data\_array” calls $fread first, and still, it is “data\_array”, what stores zeroes, and “video\_data” stores true values, read from file (still, it calls $fread second). However, i tried to do, what you recommended, now my code is:

…  
$frewind(file\_id);  
a = $fread(data\_array, file\_id);  
$frewind(file\_id);  
a = $fread(video\_data, file\_id);  
…

but nothing changed. “data\_array” still stores zeroes.

---

_[View the full topic](https://verificationacademy.com/forums/t/reading-file-into-dynamic-array-failed/29656)._
