easy5 pts · first answer countsswiftvalue-types
Swift struct assignment copies
What does this Swift code print?
struct Point { var x: Int }
var a = Point(x: 1)
var b = a
b.x = 5
print(a.x, b.x)Discussion 0
Join free to post in the discussion.
What does this Swift code print?
struct Point { var x: Int }
var a = Point(x: 1)
var b = a
b.x = 5
print(a.x, b.x)Join free to post in the discussion.