0
Function Parameter Names - with in-out parameter
I don't understand the last blank, someone could help me and explain me the answer? func calc(num: inout Int) { num = num*5 } var a = 8 calc(num: )
2 ответов
+ 1
When calling a function/method that uses an inout parameter in Swift, you need to pass the address of '&' the variable 'a' being passed to the function/method. Go to the lesson just before this question and re-read it. Be sure to check out the example code and 'try it'.
0
@chaoticDawg : Thank you for your reply and explanation, very clear !