C#
public class Lesson08
{public int[,] array = new int[2, 2] { { 1, 2 }, { 3, 4 } };}
lua
- 长度
local obj=CS.Lesson08()
tl=obj.array:GetLength(0)–行
tl=obj.array:GetLength(1)–列 - 获取数值
print(obj.array:GetValue(0,0)) - 遍历
for i=0,obj.array:GetLength(0)-1 do
for j=0,obj.array:GetLength(1)-1 do
print(obj.array:GetValue(i,j))
end
end