我无法弄清楚separateAda 中的关键字及其深度概念。请举个小例子帮助我理解?
假设我有一个嵌套过程
with ada.text_io; use ada.text_io;
procedure main is
procedure proc is
begin
put_line ("i am proc");
end proc;
begin
put_line ("main");
end main;
Run Code Online (Sandbox Code Playgroud)
如何使用单独的关键字?
如何像C中的指针一样增加访问类型的地址?我是阿达新手......
procedure main is
type myarr is array(1..5)of integer; --creating array of 5 integer.
myarr_var:aliased myarr:=(2,5,7,9,0); --setting 5 values
type my_access is access all myarr; --creating access type (pointer)
var:my_access:=myarr_var'access; --holding address of 5 integer
begin;
-- since var holds the address of myarr_var now i want to increment
-- the address by adding 1 to print next value (5) as we do in c?
put((var+1).all); --???
-- i know this is bad but how to increment its base address …Run Code Online (Sandbox Code Playgroud) ada ×2