I just read the following text in my Swift instruction book:
inoutbefore the parameter type indicates that this parameter should be copied in, that local copy used within the function, and copied back out when the function returns.
Can someone please explain what this means? I understand pass-by-value (to copy a value to another location in memory). But I don't understand the above quote from my Swift book.
...this parameter should be copied in...
Copied in or into where?
...and copied back out...
What do they mean by "copied back out"? (I don't understand how something is "copied out".)
Could someone please fill me in on what this text means? I'm a beginner, so please keep that in mind when explaining. Thank you so much.