with Ada.Text_IO,Ada.Integer_Text_IO,Ada.Float_Text_IO;
use Ada.Text_IO,Ada.Integer_Text_IO,Ada.Float_Text_IO;
procedure Access2 is
type POINT_TO_INT is access Integer;
Index,Arrow:POINT_TO_INT;
type POINT_TO_FLOAT is access Float;
X,Y,Z:POINT_TO_FLOAT;
begin
Index:=new Integer'(173);-- 一个空的integer类型被创建,并且赋值为173,index变量指向这个未命名的地址空间,从而index的值为173
Arrow:=new Integer'(57);Put("The values are:");Put(Index.all,6);Put(Arrow.all,6);
New_Line;
Index.all:=13;-- the value stored at the place where Index points
Arrow.all:=Index.all;
Index:=Arrow;
X:=new Float'(3.14159);
Y:=X;
Z:=X;Put("The float values are");Put(X.all,6,6,0);Put(Y.all,6,6,0);Put(Z.all,6,6,0);
New_Line;
X.all:=2.0*Y.all;Put("The float values are");Put(X.all,6,6,0);Put(Y.all,6,6,0);Put(Z.all,6,6,0);
New_Line;
end Access2;