|
int thefunc(lua_State *L) { lua_newtable(L); // check parameters ... for(int i = 1; i <= someValue; i++){ ... lua_pushnumber(L,i); // the index lua_pushstring(L,someString); lua_settable(L,-3); } return 1; }
Your approach is okay, but could be improved using lua_rawseti: http://www.lua.org/manual/5.0/manual.html#3.13 Ashwin. -- no signature is a signature.