lua-users home
lua-l archive

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


On Fri, Jan 9, 2009 at 10:29 PM, James Rhodes wrote:
>  cout << i << ": string : " << lua_tostring(lstack,i) << endl;\

Careful: lua_tostring has side-effects[1] (perhaps the name of this
function is misleading).  It's also more correct to do
"if(lua_toboolean(lstack,i) != 0)" .

[1] http://www.lua.org/manual/5.1/manual.html#lua_tolstring