cstringluaarmembedded-language

Calling a Lua string with C


I'm trying to learn how to use Lua with C, so by now I want to try running a script without loading it from a file, since I don't want to be bothered with messing up with files. Can anybody tell me which functions do I need to call for executing a simple string or what ever?


Solution

  • You can use luaL_dostring to execute a script from a string.

    If you need help with the basics (creating a Lua state, etc.), read part IV of Programming in Lua.