Я хочу создать таблицу, например
myTable = {
[0] = { ["a"] = 4, ["b"] = 2 },
[1] = { ["a"] = 13, ["b"] = 37 }
}
используя C API?
Мой текущий подход
lua_createtable(L, 0, 2);
int c = lua_gettop(L);
lua_pushstring(L, "a");
lua_pushnumber(L, 4);
lua_settable(L, c);
lua_pushstring(L, "b");
lua_pushnumber(L, 2);
lua_settable(L, c);
для создания внутренних таблиц в цикле. До этого цикла я использовал
lua_createtable(L, 2, 0);
int outertable = lua_gettop(L);
создать внешнюю таблицу для 2-х числовых слотов.
Но как я могу сохранить внутренние таблицы во внешнюю таблицу?