Created
May 11, 2020 21:49
-
-
Save hossamghareeb/645dc18e0e39386689902c4c87759851 to your computer and use it in GitHub Desktop.
structs memberwise init
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Player { | |
let name: String | |
var score: Int = 0 | |
} | |
let p1 = Player(name: "John") | |
let p2 = Player(name: "Sam", score: 100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment