Notes
- This property returns the same result as the C.type() function.
- If the Array is a C Array definition, the property returns the string
"Array<cdef>"
Array.type readonly
Gets the type of elements stored in the C Array, as a string
.
Example
local c = require 'c'
-- Defines a C array with 3 rows of 4 chars
local CharArray = c.Array("c", 3, 4)
-- Creates a new CharArray with an initialization table
local array = CharArray {
{ "a", "b", "c", '\0' },
{ "d", "e", "f", '\0' },
{ "g", "h", "i", '\0' }
}
-- Prints the array elements type
print(c.type(CharArray))