Passing table with fields as an argument to Lua function from C++?
问题 I would like to know how to form a Lua table with fields and values so I can pass it as an argument to a Lua function from C++. I know how to form a table using indices but I don't know how to from a table made of fields and values. For example, I want to send this table to a Lua function as an argument from C++. t = {xpos = 50, ypos = 80, message = 'hello'} The below code is the closest I could get, but it's just indexed table with no field name. lua_getglobal(L, "myLuaFunc"); if (lua_type(L