-
Lua编程示例(六): C语言调用Lua函数
C++端:#include "stdafx.h" lua_State *L; void load_lua(lua_State **L,char *filename){ *L=luaL_newsta...
kavin 2018.05.19 2522浏览 0 -
Lua编程示例(五): C语言对Lua表的读取和添加
具体代码如下:#include "stdafx.h" lua_State *L; void load_lua(char *filename){ L=luaL_newstate(); luaL_op...
kavin 2018.05.19 2667浏览 0 -
Lua编程示例(四):Lua标准库之表库、字符串库、系统库
具体代码如下:tb1 = { "alpha","log","gamme"} print(table.concat(tb1," , ")) print(...
kavin 2018.05.19 2513浏览 0 -
Lua编程示例(三):稀疏表、双端队列、格式化输出、表和循环表的格式化输出
具体脚本如下:a={} for i=1,10 do a[i]={} for j=0,10 do if(i%2==0) then a[i][j]=0 end &nbs...
kavin 2018.05.19 2355浏览 0 -
Lua编程示例(二):面向对象、metatable对表进行扩展
具体代码如下: counter = { count = 0 } function counter.get(self) return self.count end function...
kavin 2018.05.19 2344浏览 0