在C中创建二维Lua表示例
来源:互联网 发布:完美网络刷销量 编辑:程序博客网 时间:2024/06/17 01:31
// 创建二维数组Lua表void createLuaTable2(lua_State *L, const char* t){lua_newtable(L); // t//========================lua_pushinteger(L, 1); // t[1]lua_newtable(L); // p1// p1[1] = 100lua_pushinteger(L, 1);lua_pushinteger(L, 100);lua_settable(L, 3);// p1[2] = 200lua_pushinteger(L, 2);lua_pushinteger(L, 200);lua_settable(L, 3);// p1[3] = 300lua_pushinteger(L, 3);lua_pushinteger(L, 300);lua_settable(L, 3);// t[1] = p1lua_settable(L, 1);//==========================lua_pushinteger(L, 2); // t[2]lua_newtable(L); // p2// p2[1] = 'AAAA'lua_pushinteger(L, 1);lua_pushstring(L, "AAAA");lua_settable(L, 3);// p2[2] = 'BBBB'lua_pushinteger(L, 2);lua_pushstring(L, "BBBB");lua_settable(L, 3);// p2[3] = 'CCCC'lua_pushinteger(L, 3);lua_pushstring(L, "CCCC");lua_settable(L, 3);// t[2] = p2lua_settable(L, 1);//=========================lua_setglobal(L, t); // 设置全局变量}/*createLuaTable2(L, "aaa"); 等价于Lua代码:-- 全局变量aaa = {{100,200,300},{"AAAA", "BBBB", "CCCC"}};*/
0 0
- 在C中创建二维Lua表示例
- lua 创建二维数组
- Lua 在Lua中调用C函数
- 在MySQL中存储二维Excel表示的方法
- 在堆中创建二维数组
- 在lua中创建类和对象
- [译]在C中表示补码最小值
- Ubuntu下安装Lua以及在C中调用Lua
- Lua 在C程序中进行Lua表操作
- Lua 在C程序中调用Lua函数
- 在Lua中管理C对象
- 在C/C++中使用lua
- 在Lua中调用C函数
- 在C中调用Lua代码
- 在C/C++项目中集成Lua
- c语言二维数组怎么表示
- C语言指针表示二维数组
- C语言中动态二维数组的创建
- 欢迎使用CSDN-markdown编辑器
- Unity4 升级到 Unity5 更新小记
- 解决Error in module RSQL of the database interface
- 平凡而又神奇的贝叶斯方法
- Android之Service与IntentService的比较
- 在C中创建二维Lua表示例
- List的sort中的Comparator的使用和原理
- Objective-c中@interface、@implementation、@protocal、id
- cocos2dx 2.x定时器分析(1)
- 修改linux文件权限命令:chmod
- Android中InputStream与String,Byte之间互转
- strcpy函数的实现
- java 判断字符串是否为数字
- 【转】c# int 和 byte数组 互相 转换