inout

How to use inout parameters?

All function parameters in Swift are constants by default. That means you can not change the value of the parameters. Trying to change the value of a function parameter from within the body of that function results in a compile-time…