tw16772.pp 499 B

12345678910111213141516171819202122232425262728293031323334
  1. {$ifdef fpc}{$mode delphi}{$endif}
  2. {$ifdef MSWindows}{$apptype console}{$endif}
  3. uses
  4. SysUtils;
  5. type
  6. PByteArray=^TByteArray;
  7. var
  8. g : array [byte] of byte;
  9. function GetArray: PByteArray;
  10. begin
  11. Result:=@g[0];
  12. end;
  13. var
  14. p : PByteArray;
  15. begin
  16. g[0]:=111;
  17. g[1]:=221;
  18. g[2]:=252;
  19. p:=PByteArray(@GetArray[0]);
  20. if p[0]<>111 then
  21. halt(1);
  22. p:=PByteArray(@((GetArray))[1]);
  23. if p[0]<>221 then
  24. halt(2);
  25. p:=PByteArray(@(GetArray[2]));
  26. if p[0]<>252 then
  27. halt(3);
  28. end.