TParent = object
   A : integer;
end;

TChild=object(TParent)
   B : integer;
end;


var
   Parent : TParent;
   Child : TChild;


 begin

    Child.A := 10;
    Child.B := 20;

Parent := TParent(Child );// is this always safe ? Will it copy ONLY the 'A' field to 'parent'? Will it overwrite some memory space beyond the legitimate boundary of 'parent'?

end.


Thanks a lot in advance.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to