[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Best way to pass a table of floats to a C function ?
- From: Luc Van den Borre <lucv@...>
- Date: Tue, 2 Jun 1998 17:14:23 +0100
Hello all,
Right now I'm using this snippet of code to do this:
loObject = lua_getparam(1);
luaL_arg_check(lua_istable(loObject), 1, "table expected");
lua_pushobject(loObject);
lua_pushnumber(1);
nNumber = lua_getnumber(lua_gettable());
It gets the first number from the table that was passed to my C function from Lua.
However, I've got a feeling that this is a very roundabout way of doing things...
Does Lua store all values in a table in a continuous block ?
Could I perhaps just pass a pointer to this memory to my C function ?
Or am I completely barking up the wrong tree here ?
Thanks for any help,
--Luc