Pass Lua scripts from C to Lua

I want to pass a Lua script (code that can be processed by the Lua interpreter) from C and return the result.

I looked at it on the Internet, but I found There are not any examples that can help me. I can call Lua functions from C, but this requires you to create a file with Lua functions.

try to use luaL_dostring, it loads and runs the given string.

I want to pass a Lua script from C (code that the Lua interpreter can handle ) And return the result.

I looked online, but couldn’t find any examples that can help me. I can call Lua functions from C, but this requires you to create a Lua function File.

Try to use luaL_dostring, which loads and runs the given string.

Leave a Comment

Your email address will not be published.