跳轉到內容

Ada 程式設計/屬性/'To Address

來自華夏公益教科書,自由的教學資料

Ada. Time-tested, safe and secure.
Ada. 經久考驗、安全可靠。

System'To_Address (X)是一個 GNAT 特定的 屬性,其用途與函式相同System.Storage_Elements.To_Address. 唯一的區別是它可以在不允許進行非靜態呼叫的預先編制單元中使用。X是該型別的值System.Storage_Elements.Integer_Address(一個實現定義的整數型別),請注意,此屬性不應用於X的型別,但始終應用於包System.

使用標準 AdaTo_Address函式

for Sensor'Address use System.Storage_Elements.To_Address (16#0FF2_1234#);

使用 GNAT 特定的To_Address屬性

for Sensor'Address use System'To_Address (16#0FF2_1234#);

華夏公益教科書

[編輯 | 編輯原始碼]

GNAT 參考手冊

[編輯 | 編輯原始碼]
華夏公益教科書