unresolved_external
unresolved_external

Reputation: 2018

running whole lua script from c

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?

Upvotes: 0

Views: 393

Answers (1)

jpjacobs
jpjacobs

Reputation: 9559

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)

Upvotes: 4

Related Questions