go-tour/pointers.go

17 lines
177 B
Go
Raw Permalink Normal View History

2020-02-05 03:44:36 +00:00
package main
import "fmt"
func main() {
i, j := 42, 2701
p := &i
fmt.Println(*p)
*p = 21
p = &j
fmt.Println(i)
*p = *p / 37
fmt.Println(j)
}