下面的代碼不會崩潰,但我不能推斷爲什麼,給定「有限」的文檔可用。 func foo(inout a: [Int], inout b: Int) {
a = []
b = 99
}
var arr = [1,2,3]
// confusion: where does the "out" of b go to?
// storage for a was already
我一直聽到這個錯誤,說無效的語法,我真的迷路了,不知道爲什麼! def calculator():
def add(x, y):
return x + y
def subtract(x, y):
return x - y
def multiply(x, y):
return x * y
def devide(x, y):
return x/