Create a table for LUA stack in C
来源:互联网 发布:用户画像数据分析工具 编辑:程序博客网 时间:2024/05/16 11:05
static int getUsers(lua_State *L)
{
char *name[3]={"chen","Li","Huang"};
char *sex[3]={"male","female","female"}
int i;
lua_newtable(L);
for (i=0;i<3;i++)
{
lua_newtable(L);
/*set child table*/
{
lua_pushstring(L, "name");
lua_pushstring(L, name[i]);
lua_settable(L,-3);
lua_pushstring(L, "sex");
lua_pushstring(L, sex[i]);
lua_settable(L,-3);
}
/*set child table key*/
lua_rawseti(L, -2, i+1);
}
return 1;
}
LUA SCRIPT
local users=getUsers()
users[1].name,users[1].sex
- Create a table for LUA stack in C
- Create a global table for LUA stack
- 22.You need to create a table for a banking application. One of the columns in the table has the fol
- Use linked list to create queue stack BST in C
- Create a maintenance view for SAP standard table
- create table for db
- Example for lua table
- create a deployment package for Webservice in Visual Studio
- Lua stack dump for c++
- Create Table in HANA DB
- create tcode for maintence table
- Create Temp Table for SP_WHO
- CREATE TABLE A LIKE B
- Design a class named Queue for storing integers. Like a stack, a queue holds elements. In a stack,
- SQL: CREATE a table from another table
- Obtaining a stack trace in C upon SIGSEGV
- Lua的for in
- A. Maximum in Table
- 定义函数指针的两种形式
- SQL 优化
- CRC算法原理及C语言实现(介绍了3种方法)
- 东圃张樟兴培养学生创新和思维能力
- JSP Request attribute 和 parameter的区别
- Create a table for LUA stack in C
- 浅析C#的事件处理和自定义事件
- JSP中显示中文图片
- php 取整
- 多态性
- Create a global table for LUA stack
- LINUX下图形界面——文本模式切换
- Java应用在多核服务器上压力不均衡问题
- Linux的快捷键和主要命令