Values & References8 / 16
Up next

inout parameters

// inout writes back into the caller's variable
func bump(_ n: inout Int) {
    n += 1
}
var x = 10
// & marks the argument as inout at the call site
bump(&x)
print(x)
What you're solving

pass a variable to be modified