swift语法--02元祖

2016-03-09  本文已影响62人  20b347b28fc9

swift语法--元祖


元祖
let number3: (Int, Double, Int, Double) = (10, 10.1, 9, 44.40)
//通过 点+下标 的方式获取元祖中的值 
number3.0
number3.1
number3.2
number3.3
let person = (name: "erer", age: 18, score: 100.0)
person.name
person.age
person.score
let (name, age, score) = ("erer", 18, 100.0)
name
age
score
上一篇下一篇

猜你喜欢

热点阅读