Pointers and references: Difference between revisions

m
Line 39:
Item : Element renames Container (I);
begin
Do_Something(Item); ... -- Here Item is a reference to Container (I)
end;
end loop;</lang>
 
The forthcoming standard (Ada 2012) allows a more direct way to reference all the items in a container or an array:
 
<lang ada>type Container is array (Positive range <>) of Element;
for Item of Container loop
Do_Something(Item) ...
end;
end loop;</lang>
 
=={{header|ALGOL 68}}==
The following code creates a pointer to an INT variable:
Anonymous user