[fpc-pascal]help with pointers?

the reverend the.reverend at coastgames.com
Fri Oct 19 23:58:58 CEST 2001


given the following:

-------------
program test;
var p: ^word;
begin
  if assigned(p) then writeln('assigned')
  else writeln('unassigned');
end.
-------------

p is unassigned as expected, but:

------------
program test;

procedure temp;
var p: ^word;
begin
  if assigned(p) then writeln('assigned')
  else writeln('unassigned');
end;

begin
  temp;
end.
-------------

why is p assigned?  shouldn't p be nil in this case also?




More information about the fpc-pascal mailing list