[fpc-pascal] Dynamic array initialization

leledumbo leledumbo_cool at yahoo.co.id
Tue Mar 18 05:07:29 CET 2014


> Are dynamic arrays initialized with nil after the setlength 
call?

>From https://github.com/graemeg/freepascal/blob/master/rtl/inc/dynarr.inc:
You can see that the storage is allocated with GetMem and initialized with
FillChar 0. So if the base element is pointer, the contents are initialized
with nil.



--
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Dynamic-array-initialization-tp5718639p5718640.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.



More information about the fpc-pascal mailing list