Если все-таки будет желание.
Наткнулся на такую весч:
Цитата
-- Declare a struct with a parameterized field type and name:
ffi.cdef([[
typedef struct { $ $; } foo_t;
]], type1, name1)
-- Anonymous struct with dynamic names:
local bar_t = ffi.typeof("struct { int $, $; }", name1, name2)
-- Derived pointer type:
local bar_ptr_t = ffi.typeof("$ *", bar_t)
-- Parameterized dimensions work even where a VLA won't work:
local matrix_t = ffi.typeof("uint8_t[$][$]", width, height)
Собственно из вышеописанного:
Код
local arr = ffi.typeof("int[$][$]", 10, 10)
log(tostring(arr))
arr[1][1] = 1
Создается некоторый объект, который вроде как указатель на правильный массив, но без адреса. Соответственно присвоение ничего не дает и выбивает ошибку, что не может индексивать чилом данный ctype.