using inout parameters on structs
struct val { var f:Int } func addto(inout num:val, amount:Int) { num.f += amount } //inout parameter allows changing value types without reassigning var test = val(f:8) addto(&test, amount: 4) test.f