How would I pass a table of unknown length from Lua into a bound C++ function?
I want to be able to call the Lua function like this:
call_C_Func({1,1,2,3,5,8,13,21})
And copy the table contents into an array (preferably STL vector)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you use LuaBind it’s as simple as one registered call. As for rolling up your own, you need to take a look at lua_next function.
Basically the code is as follows: