How can I know return value count of a Lua function from C?

Viewed 3476
luaL_loadstring(L, "return 3, 4, 5");
int R       =   lua_pcall(L, 0, 3, 0);

Lua can return multiple values. But currently I have to hardcode the count of the return values. Can I know the count at runtime dynamically?

1 Answers
Related