Guest User

Untitled

a guest
Apr 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. var param = "try change me brother"
  2. func defaultFunc(_ param:String) {
  3. // param = "I change you" won't compiles
  4. }
  5. defaultFunc(param)
  6. print(param) // try change me brother
  7. func inOutFunc(_ param :inout String) {
  8. param = "I changed you"
  9. }
  10. inOutFunc(&param) // needs explicit &
  11. print(param) // I changed you
Add Comment
Please, Sign In to add comment