import Foundation import Glibc protocol Example{ var desc:String { get } mutating func adjust() } class Ex:Example { var desc="hi this is an example" func adjust() { desc+="Bye now!" } } //var a=Ex(); //a.adjust() //print(a.desc) struct Simple:Example { var desc="dks;ks" mutating func adjust() { desc+=("desc") } } var A=Simple() print(A.desc) A.adjust() print(A.desc)
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more