Walkthrough Lua script from C ++ to Lua

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

I looked online, but could not find a single example that would help me. I can call the Lua function from C ++, but this requires creating a file with the Lua function.

+4
source share
1 answer

Try using luaL_dostring , which loads and runs the given string.

+6
source

Source: https://habr.com/ru/post/1493220/


All Articles