Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var param = "try change me brother"
- func defaultFunc(_ param:String) {
- // param = "I change you" won't compiles
- }
- defaultFunc(param)
- print(param) // try change me brother
- func inOutFunc(_ param :inout String) {
- param = "I changed you"
- }
- inOutFunc(¶m) // needs explicit &
- print(param) // I changed you
Add Comment
Please, Sign In to add comment