with Ada.Text_IO,Ada.Integer_Text_IO;
use Ada.Text_IO,ADA.Integer_Text_IO;
procedure Access1 is
type POINT_SOMEWHERE is access Integer;
Index,Arrow,There:POINT_SOMEWHERE;
begin
Index :=new Integer;
Index.all :=Index.all +16; -- all属性 用来访问新创建的变量index在内存中的值
Put("The value is ");
Put(Index.all ,6);
New_Line;
Arrow:=new Integer;
Arrow.all:=Index.all+16;
There:=Arrow;
Put("The values are now");
Put(Index.all,6);
Put(" ");
Put(Arrow.all,6);
Put(" ");
Put(There.all,6);
New_Line;
There.all :=21;
Put("The values are now");
Put(Index.all,6);
Put(Arrow.all,6);
Put(There.all,6);
New_Line;
end Access1;
059.Ada变量中的All属性
最新推荐文章于 2024-05-21 15:56:17 发布