I am started to learn Lua few days ago and faced next problem. How can I run the whole lua script form C program, for example, I have a lua script and read it like a text file in my C program so how can I run this script from C side?
1 Answer
By using luaL_dofile. even no need to read the text file in separately.
In Programming in Lua, they do it using luaL_loadfile (to allow for some more flexibility)
2 Comments
unresolved_external
But now I faced one more problem, how can I create a table in Lua from C-side, and then pass this table to the function
jpjacobs
This is a different question, but I could give you the general hint of reading the pil book I linked in my answer.