@@ -29,7 +29,7 @@ P.name = "Astaxie" // assign "Astaxie" to the field 'name' of p
|
||||
P.age = 25 // assign 25 to field 'age' of p
|
||||
fmt.Printf("The person's name is %s\n", P.name) // access field 'name' of p
|
||||
```
|
||||
There are three more ways to define a struct.
|
||||
There are three more ways to initialize a struct.
|
||||
|
||||
- Assign initial values by order
|
||||
```Go
|
||||
|
||||
Reference in New Issue
Block a user