Let say if I have a table
table1={}
how can I copy all the content in table1 to table2 that tabel2 will not share the same address with table1.
local t1 = {1,3,5,7,9}
local t2 = {2,4,6,333}
t2[6] = 555 – create hole
local t3 = {11,13,17,19}
local c = table.copy( t1, t2, t3 )
– output: 1, 3, 5, 7, 9, 2, 4, 6, 333, 11, 13, 17, 19
print( table.concat( c, ", " ) )
the example above will share the same address
what I want is:
table1[1]=1 adresss:xxxx2
table2[1]=1 address:xxxx1 completely different address