Swift - Functions
Identify the error in this Swift code snippet:
func increment(_ value: inout Int) {
value += 1
}
let number = 10
increment(&number)Identify the error in this Swift code snippet:
func increment(_ value: inout Int) {
value += 1
}
let number = 10
increment(&number)number is declared with let, making it a constant.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions