Swift - Operators and Expressions
Consider this code snippet:
What is the output?
struct Vector {
var x: Int
var y: Int
static func * (lhs: Vector, rhs: Int) -> Vector {
return Vector(x: lhs.x * rhs, y: lhs.y * rhs)
}
}
let v = Vector(x: 2, y: 3)
let result = v * 4
print(result.x, result.y)What is the output?
