0
Why is the answer 2 1 1 ?
Which choice is the output value of the following code: var a = 0 let b = ++a let c = a++ print("\(a) \(b) \(c)") Why does \(a) = 2 ?
1 Antwort
+ 4
Because it has been incremented twice (first time with ++a, second time with a++). a++ doesn't mean that the incrementation isn't done, just that the value of a is used before the incrementation.