6
I can’t get value from a Lua matrix to use in C++.
So I take the value of the variable M
:
//No LUA
M = 85
//No C++
L = lua_open();
luaL_loadfile(L, "teste.lua");
lua_pcall(L, 0, 0, 0);
int m;
lua_getglobal(L, "M");
m = lua_tonumber(L, -1);
cout << m;
But I don’t know how to get the index value of a matrix as follows below:
// LUA
MATRIZ =
{
{4,2,2,6},
{2,1,1,2},
{2,1,1,2},
{5,2,2,3}
}
How to get the value of this matrix?