Array:get(indice1, [indice2],...) method

Get the Array value stored at the given position.

Parameters

indice1, [indice2],...

Successive numbers, indicating the indices in the Array.

Warning

The number of indices must be equal to the Array dimensions.

Return value

This method returns the value stored in the Array at the given position.

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' } } print(array:get(0, 0)) -- outputs "a"