RosettaCodeData/Task/Pointers-and-references/Go/pointers-and-references-6.go

6 lines
106 B
Go
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
type pt struct {
x, y int
}
return &pt{22, 79} // allocates a pt object and returns a pointer to it.