tb0433a.pp 482 B

1234567891011121314151617181920212223242526272829303132
  1. {$ifdef fpc}
  2. {$mode delphi}
  3. {$endif fpc}
  4. function times2(x : longint) : longint;
  5. begin
  6. times2:=2*x;
  7. end;
  8. var
  9. x:function(x:longint):longint;
  10. y:pointer absolute x;
  11. z,w,v:pointer;
  12. begin
  13. x:=times2;
  14. z:=@x;
  15. w:=addr(x);
  16. v:=@times2;
  17. writeln(longint(y),' ',longint(z),' ',longint(w),' ',longint(v));
  18. if (z<>w) or (z<>v) or (y<>z) then
  19. begin
  20. writeln('Addr Error');
  21. halt(1);
  22. end;
  23. if (y<>@times2) then
  24. begin
  25. writeln('Absolute Error');
  26. halt(1);
  27. end;
  28. end.