3
我正在尋找一種方法,使使用C18編譯器使用C Jalv2狀的準變量。僞變量就像一個變量,但實際上是一個函數。C18僞變量
在Jalv2,有可能使這樣的僞變量:
function the_var'get() return byte is
-- some code
end function
procedure the_var'set(byte in value) is
-- some code
end procedure
現在可以讀取和寫入the_var
,而實際上這些功能被執行:
the_var = 0x40 -- actually executes the_var'set(0x40)
doSomething(the_var) -- actually executes doSomething(the_var'get)
有什麼類似於C?
這聽起來像你所要求的在C.否「getter和setter」,這是不可能的。 – 2013-04-22 08:43:50
@DietrichEpp是否有解決方法? – Keelan 2013-04-22 08:44:04
當然,只是明確地調用函數。 – 2013-04-22 08:44:20