标签:
double z;lua_getglobal(L, "f");lua_pushnumber(L, x);lua_pushnumber(L, y);/* do the call (2 arguments, 1 result) */if (lua_pcall(L, 2, 1, 0) != 0)error(L, "error running function ‘f‘: %s",lua_tostring(L, -1));if (!lua_isnumber(L, -1))error(L, "function ‘f‘ must return a number");z = lua_tonumber(L, -1);lua_pop(L, 1);return z;
标签:
原文地址:http://www.cnblogs.com/cjswwdz/p/5625489.html