Let's say we have a struct named Person
and it's held by a struct named People
.
type Person {
Name string
age int
}
type People {
City string
List []*Person //check this out
}
type People2 {
City string
List *[]Person //What's the difference?
}
What's exactly is the meaning of
[]*Person
and*[]Person
?How can I retrieve the element's value of these slice?
I'm more familiar with C so it's appreciated if you can explain this in C