[fpc-pascal] Variable Initialization Questions

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Feb 17 18:16:18 CET 2016


Jonas Maebe wrote:
>> 3 - When i declare a pointer as a global variable or as a member of a
>> record, can i assume that its initial value is nil?
>
> No.

Correction: all global variables are always zeroed, so that includes 
pointers, records and hence also pointers in records (if those records 
themselves are global variables). Pointers, records or record fields in 
are not zeroed because they are pointers/records/record fields though 
(so not in case they are local variables).


Jonas



More information about the fpc-pascal mailing list