Examples · learn/11-values · 170 of 339
copy-struct
tin run examples/learn/11-values/copy-struct.tintype Robot = { name: string, battery: int }
fn main() {
var first = Robot { name: "Bud", battery: 90 }
var second = first // a copy, not a second name for the same robot
second.name = "Petal"
second.battery = 40
print(first)
print(second)
}