[fpc-pascal] Re: two questions about dynamic array
Xiangrong Fang
xrfang at gmail.com
Tue Mar 12 09:30:14 CET 2013
Sorry the array should be dynamic, without [0..100].
2013/3/12 Xiangrong Fang <xrfang at gmail.com>
> Hi All,
>
> I have two simple questions:
>
> 1) As far as I know class variables in FPC are automatic initialize to the
> NULL value (e.g. 0 or "" or whatever), does that include dynamic arrays?
> e.g.
>
> TMyClass = class
> myarray: array[0..100] of Integer;
> end;
>
> will myarray be initialized to nil?
>
>
> 2) After SetLength(myarray, 0), is myarray nil or pointing to some invalid
> address?
>
> Thanks
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130312/5d129d42/attachment.html>
More information about the fpc-pascal
mailing list