Error on one struct but not on the other

Why the difference between Person1 and Person2?
No description
4 Replies
aelfled
aelfled16mo ago
your syntax is invalid in Person2, you are assigning rather than declaring the type, so it wants an argument like String(repeating: "Foo", count: 2)
Pointer
PointerOP16mo ago
sorry, what do repeating and count mean? I don't understand
aelfled
aelfled16mo ago
they are init arguments for the String struct type
Pointer
PointerOP16mo ago
I see, thank you!

Did you find this page helpful?