Well I meant more strait forward than:
a = {0,1,2.3}
local vla = ffi.new("int[?]", #a, unpack(a))
i = lib.arr1(#a, vla)
local t = {}
for i = 0, #a-1 do
t[#t+1] = vla[i]
end
:-)
On 2015-07-11 3:25 PM, voidptr69@xxxxxxxxxxx wrote:
noob question,
in the motivation example we allocate space for a C array with
local img = ffi.new("rgba_pixel[?]", n)
but how can the reverse
transfering my C array of some type (at least int char ... ) into a lua table
:-)