Structs
A struct
is a collection of fields. Struct fields are accessed using a dot.
Example
Pointers to Structs
Struct fields can also be accessed using a struct pointer.
Struct Literals
A struct literal denotes a newly allocated struct value by listing the values of its fields. The predix &
returns a pointer to the struct value.
Last updated
Was this helpful?