2012-08-30 28 views

回答

4

In the book.
In the manual.

// lua function that expects a single number argument 
int myfunction(lua_State* L) 
{ 
    double argument = lua_tonumber(L, 1); 
    return 0; 
} 
+0

您還需要啓用此功能,以Lua腳本。使用'lua_register'是一種方法。 – lhf

+0

我正在尋找一種方法將函數參數傳遞給lua_CFunction – Goles

+0

'myfunction(print)'o.O – Mud

相關問題