RosettaCodeData/Task/Create-an-object-at-a-given-address/Ada/create-an-object-at-a-given-address-2.ada
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

13 lines
387 B
Ada

with Ada.Text_IO; use Ada.Text_IO;
with System.Storage_Elements; use System.Storage_Elements;
procedure Test_Address is
X : Integer := 123;
Y : Integer;
for Y'Address use X'Address;
begin
Put_Line ("At address:" & Integer_Address'Image (To_Integer (Y'Address)));
Put_Line (Integer'Image (Y));
X := 456;
Put_Line (Integer'Image (Y));
end Test_Address;