У меня есть функция ac, используемая для возврата таблицы в lua, но таблица создается из строки, а не lua_newtable, как это сделать?
int GetTable(lua_State* L)
{
//this string is generated at runtime, so i can not use lua_newtable
const char* TableFromStr = "{a = 123, b = 456, d = {x = 1, y = 9} }";
//i want to push the table to the top stack
luaL_loadstring(L, TableFromStr);
//return 1 table, lua code can get the table
return 1;
}