You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
241 B

package main
import "fmt"
type point struct {
x int
y int
}
func setPoint(ptr *point) {
ptr.x = 42
ptr.y = 21
}
func main() {
points := &point{}
setPoint(points)
fmt.Printf("x = %d, y = %d", points.x, points.y)
fmt.Println()
}