< Ada Programming < Attributes 
 
 
      
Ada. Time-tested, safe and secure.
Description
X'Access is an Ada attribute where X is any object or subprogram.
'Access may be used to return an access value designating the object or subprogram.
Example
typeGeneral_PointerisaccessallInteger;typeConstant_PointerisaccessconstantInteger; I1:aliasedconstantInteger := 10; I2:aliasedInteger; P1: General_Pointer := I1'Access; -- illegal P2: Constant_Pointer := I1'Access; -- OK, read only P3: General_Pointer := I2'Access; -- OK, read and write P4: Constant_Pointer := I2'Access; -- OK, read only P5:constantGeneral_Pointer := I2'Access; -- read and write only to I2
typeCallback_Procedureisaccessprocedure(Id : Integer; Text: String);procedureProcess_Event (Id : Integer; Text: String); My_Callback: Callback_Procedure := Process_Event'Access;
See also
Wikibook
Ada Reference Manual
    This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.