Array.length readonly



Gets the number of elements in the C Array, in bytes.

Example

local c = require 'c' -- Defines a 2x2 C array of integers local IntArray = c.Array("i", 2, 2) -- prints the length of IntArray (2x2 elements) print("Number of elements :\t"..IntArray.length) -- prints the size of IntArray (2x2 elements of 4 bytes) print("Memory size in bytes :\t"..IntArray.size)