local tb = {0,1,2,3,4,5,["a"] = 1, ["b"] = 2}
print(tb[1] .. " " .. tb.a .. " " .. tb.b)
local tb1 = tb
tb1.a = 5
print(tb.a) -- 5
lua 表赋值是引用关系
最新推荐文章于 2024-07-18 02:34:43 发布
local tb = {0,1,2,3,4,5,["a"] = 1, ["b"] = 2}
print(tb[1] .. " " .. tb.a .. " " .. tb.b)
local tb1 = tb
tb1.a = 5
print(tb.a) -- 5