I'm trying to figure out how to get the returned table from the Lua function in C++.
My code:
if (lua_pcall(L, 0, 1, 0)) {
std::cout << "ERROR : " << lua_tostring(L, -1) << std::endl;
}
vector<float> vec;
if (lua_istable(L, -1) {
//how to copy table to vec?
}
How can I copy the returned table to vector if the table size is unknown? Thanks!