Warning
The number of indices must be equal to the Array dimensions.
Array:set(ndice1, [indice2],..., value) method
Sets value stored at the given Array position.
Parameters
indice1, [indice2],...
Successive numbers, indicating the indices in the Array
value
The last parameter is the value to be used to set the Array at the given position
Return value
This method returns no value.Example
local c = require "c"
-- Creates a 2 dimensions C array with 3 rows of 4 chars
local CharArray = c.Array("c", 3, 4)
local array = CharArray {
{ "a", "b", "c", '\0' },
{ "d", "e", "f", '\0' },
{ "g", "h", "i", '\0' }
}
array:set(0, 0, 65)
print(array:set(0, 0)) -- outputs "A"