I started using C++ dll with lua together. It's very hard to start. I need help to work with tables. I do the following in my C++ code:
static int forLua_AddTwoNumbers(lua_State *L) {
double d1 = luaL_checknumber(L, 1);
double d2 = luaL_checknumber(L, 2);
lua_pushnumber(L, d1 + d2);
return(1);
}
and call this function in lua:
r = runfast.AddTwoNumbers(2, 5)
It works. How can I do the same with a table like this:
lua table t={1=20, 2=30, 3=40}