[fpc-pascal] initializing pointer values
dhkblaszyk at zeelandnet.nl
dhkblaszyk at zeelandnet.nl
Fri Dec 16 09:47:49 CET 2011
On implementing a linked list I hit to some unexpected (doesn't
mean incorrect though) behaviour.
ptest = ^test;
test = record
p:
pointer;
end;
new(mytest);
When I allocate "mytest" the pointer
variable "p" is initialized as $ffffffff instead of nil as I did
suspect. In my code though I am relying on the fact that new pointers
are indeed nil so I can allocate them accordingly. How can I force and
rely on the fact that p is always nil? What is the correct procedure
here?
TIA, Darius
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20111216/9777aa67/attachment.html>
More information about the fpc-pascal
mailing list