lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hi guys,
I have a question when I read the manual.
lua_gettable could get table, and lua_getfield could get specific key.

If I only know the table in top of stack like:

local tbl_sample = {a = "aaa", b = "bbb", c= "ccc", 15}

How could I get the information of table key-value pairs in c? And the case is I don't know the key.

Just like the function ipairs(), it doesn't need to know the key before using the table.

I read the source code of ipairs(), it says to use upvalue to aux the function.
Who could give me c code sample for it?