欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Lua中table里內(nèi)嵌table的例子

 更新時(shí)間:2015年04月22日 11:09:45   投稿:junjie  
這篇文章主要介紹了Lua中table里內(nèi)嵌table的例子,本文同時(shí)講解了如何訪問內(nèi)嵌table方法的例子,需要的朋友可以參考下

廢話不多少,看代碼:

復(fù)制代碼 代碼如下:

local temp_insert_table_Data = { 
    x = "test3",   
    y = "test4",   
    z = "test5" , 

 
local temp_insert_table = { 
    x = 1, 
    y = 2, 
    z = 3, 
    {   a = -1, a1 = 1}, 
    {   b = -2, b1 = 2}, 
    {   c = -3, c1 = 3}, 
     
    temp_insert_table_Data_ = temp_insert_table_Data, 
 

 
temp_insert_table.temp_insert_table_Data_ = temp_insert_table_Data 
 
print(temp_insert_table.y) 
print(temp_insert_table[1].a) 
print(temp_insert_table.temp_insert_table_Data_.x) 

可以直接通過table_name去訪問成員數(shù)據(jù)!
輸出結(jié)果:
復(fù)制代碼 代碼如下:

2
-1
test3

相關(guān)文章

最新評論