Question : Function Parameters Swift
Answered by : samer-saeid
// function with two parameters
func addNumbers(num1: Int, num2: Int) { var sum = num1 + num2 print("Sum: ",sum)
}
// function with no parameter
func addNumbers() { // code
}
Source : | Last Update : Thu, 23 Jun 22
Question : Swift Function Parameters
Answered by : samer-saeid
func addNumbers(a: Int, b: Int) { var sum = a + b print("Sum:", sum)
}
addNumbers(a: 2, b: 3)
Source : | Last Update : Thu, 23 Jun 22
Question : Swift Function With inout Parameters
Answered by : samer-saeid
func changeName(name: String) { if name == ""{ // Cause Error name = "Ross" }
}
Source : | Last Update : Thu, 23 Jun 22