|
zhiguo zhao wrote:First, "_G" is a table, not a string. So lua_tostring() cannot
> But why I lua_getglobal(L,"_G") failed (I don't test this under lua5.1.4,
> but i think it works).
possibly work on it. Second, lua_typename(L, tp) expects a type
number and not a stack index. Any results you may get from that
broken C code are undefined.
Please read the documentation of the Lua/C API in the Lua manual,
if you're not familiar with its use.
--Mike