如何`lua_load()`工作? [英] How does `lua_load()` work?
本文介绍了如何`lua_load()`工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将如何加载的Lua code的一大块作为字符
键,使用此功能运行呢?如果没有,我可以用什么其他的功能和如何做 lua_load()
工作?
How would I load a chunk of Lua code as a char
and run it using this function? If not, what other function can I use and how does lua_load()
work?
推荐答案
使用 luaL_dofile
和 luaL_dostring
加载和运行的Lua code。阅读他们在 lauxlib.h
定义来看看这些在低级原语条款执行。
要了解如何 lua_load
的作品,读 luaL_loadfile
和 luaL_loadstring 的code code>。
Use luaL_dofile
and luaL_dostring
to load and run Lua code. Read their definitions in lauxlib.h
to see how these are implemented in terms of lower-level primitives.
To learn how lua_load
works, read the code of luaL_loadfile
and luaL_loadstring
.
这篇关于如何`lua_load()`工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文