When trying to study ionut parameters, I came across an example of code.
This code throws an error:
"Execution was interrupted, reason: signal SIGABRT. The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation."
However, when trying to debag on a real project, po char 1.
var num1: Int = 1
var char1 = "a"
func changeNumber(num: Int) {
var num = num
num = 2
print(num) // 2
print(num1) // 1
}
changeNumber(num: num1)
func changeChar(char: inout String) {
char = "b"
print(char) // b
print(char1) // b
}
changeChar(char: &char1)
Please explain why this error is issued and how to fix it?