lua-users home
lua-l archive

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

HI all,

I am a newbie of Lua. When reading the "stack" section in "Programming in Lua", I find the following words:  

" Whenever you want to ask for a value from Lua (such as the value of a global variable), you call Lua, which
pushes the required value on the stack. Whenever you want to pass a value to Lua, you first push the value 
on the stack, and then you call Lua (which will pop the value). "

I am very confused about the above words, and there is no example to explain how to "ask for" and "pass" values
between C and Lua.

Could anyone can give some examples or explain it a bit detailedly? Thanks very much in advance!

Best Regards
Nan Xiao