Created
April 16, 2018 13:10
-
-
Save jbarros35/4ebca639123a76f62280fa911446a694 to your computer and use it in GitHub Desktop.
In Out sample Swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment